I'm creating a custom Wordpress theme and the contact page template wont process my process.php file to send mail.
The file is inside the theme folder.
However, on submission it redirects to the home page with the title of the page being file not found.
I also get this error in my MAMP access logs file:
127.0.0.1 - - [08/Aug/2016:11:55:31 +0100] "POST /wordpress-4.5.3/wordpress/contact/process.php HTTP/1.1" 404 3384
The code that is within the process.php file looks like this:
$to = "myemail@gmail.com";
$subject = htmlspecialchars($_POST['name']);
$email = htmlspecialchars($_POST['email']);
$number = htmlspecialchars($_POST['number']);
$message = htmlspecialchars($_POST['message']);
$headers = "Senders email addresS: " . $email;
$headers .= "Senders number: " . $number;
mail($to, $subject, $message, $headers);
and the template contact file looks like this:
<form method="post" action="process.php">
<p> Name: * </p>
<input type="text" name="name" required> <br>
<p> Email: * </p>
<input type="email" name="email"> <br>
<p> Phone Number: * </p>
<input type="number" name="number"> <br>
<p> Message: * </p>
<textarea name="message" required>
</textarea> <br>
<button type="submit" name="submit"> Send </button>
</form>
If anyone has any suggestions to help me fix this, I would greatly appreciate it, plus if you need any more information, let me know!
Many Thanks!