PHP contact page not sending on Wordpress website -
i'm creating custom wordpress theme , contact page template wont process process.php file send mail.
the file inside theme folder.
however, on submission redirects home page title of page being file not found.
i error in 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 within process.php file looks 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 template contact file looks 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 has suggestions me fix this, appreciate it, plus if need more information, let me know!
many thanks!
change action of form add action=<?php bloginfo('template_url'); ?>/process.php"
Comments
Post a Comment