I have a rather large form built, and unfortunately my friend is using WordPress. After much research of how to get PHP to run on an individual page, I created a custom template for the page and inserted my PHP which is to read that it was a post, and send a wp_email accordingly.
My form starts out:
<form name="healthyOrderForm" method="POST" action="/order-sent" enctype="text/plain">
the /order-sent does send it to the correct page as I can see my php response when it gets there. Form submit button is:
<input type="submit" name="send" value="Submit Order" />
PHP is:
<?php
if (isset($_POST['submit'])) {
$to = 'testemail@gmail.com';
$subject = 'New Healthy Order';
$message .= 'Location: ' . $_POST['location'] ;
$headers = "From: randomemail@gmail.com\r\n";
$headers .= 'Content-Type: text/plain; charset=utf-8';
$success = wp_mail( $to, $subject, $message, $headers);
}
?>
Any help would be greatly appreciated as I have been stuck on this for over 24 hours now.