Since the Wordpress form seems to not want to send me the password to my account for help on their forums I figured I would start here.
I have created a form for my website so that someone can contact us.
But when the person clicks the 'send' button it takes them to a 404 page, which the address reads:
website address - /working/mail.php
I know Wordpress supports .php files and I have mine correctly named and wasn't sure if I am missing something
<div id="FGSform">
<form action="mail.php" method="post" name="contactFGS" id="contactFGS">
<ul>
<li>
<label for="first-name">First Name</label>
<br>
<input type="text" id="firstname" name="firstname" required aria-required="true">
</li>
<br>
<li>
<label for="last-name">Last Name</label><br>
<input type="text" id="lastname" name="lastname" required aria-required="true">
</li>
<br>
<li>
<label for="email">Email</label>
<br>
<input type="email" id="email" name="email" required aria-required="true">
</li>
<br>
<li>
<label for="contact-reason" id="reason" name="reason">Reason for Contact</label>
<select required id="reason" name="reason">
<option value="3">Employment</option>
<option value="1">Print Services</option>
<option value="2">Design Services</option>
<option value="4">Questions</option>
<option value="5">Other</option>
</select>
</li>
<br>
<li>
<label for="comments">Comments</label>
<br>
<textarea name="comments" id="comments" cols="40" rows="10" required></textarea>
</li>
<br>
<li>
<input type="radio" id="newsletter" name="newsletter">
<label for="signmeup">Sign me up for newsletter, updates and other information about FGS</label>
</li>
<br>
<li>
<input type="submit" value="Send">
</li>
Here is my .php file:
<?php
/* Email Variables */
$emailSubject = 'mail!';
$webMaster = 'kmurray.1@frgraphicsolutions.com';
/* Data Variables */
$name = $_POST['name'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$email = $_POST['email'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Last Name: $lastname <br>
Email: $email <br>
Comments: $comments <br>
EOD;
$headers = "From: $email
";
$headers .= "Content-type: text/html
";
$success = mail($webMaster, $emailSubject, $body,
$headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="3;URL=http://frgraphicsolutions.com/working/?page_id=8">
<style type="text/css">
<!--
body {
background-color: #444;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #fec001;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
}
-->
</style>
</head>
<div align="center">Thank you!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
I have never created a form before, but Wordpress plug-ins are terrible designed and/or over complicate the form giving me little control over what I want in it.
Any help is much appreciated.