Skip to content
Advertisement

How to make a contact form in wordpress call another php file

I am trying to add a small contact form in the sidebar of my WordPress site. I transferred my code from it’s original html file into the appropriate WordPress php files. The only thing that isn’t working is the contact form.

When I click on the send button it goes to the mailer.php file in the URL bar instead of sending the message.

This is the form:

JavaScript

This is the mailer.php file:

JavaScript

Advertisement

Answer

Add a function like this to the onClick event.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement