I need help with this php form. I have triied everything. It starts with an html page with a form which has a hidden field that contains a databased email address. This email address changes depending on which page the user clicks on. I want this email to be used as the send to, but with little luck.
<form name="form1" method="post" action="/contact.php">
<input name="EmailAddy" type="hidden" id="EmailAddy" value="$art_field12$">
</form>
There are other fields but this is the on with the hidden email.
Here is the email php:
<?php
//Grab values from form
$Name = $_POST['FirstName'] . ' ' . $_POST['LastName'];
$City = $_POST['City'];
$State = $_POST['State'];
$Country= $_POST['Country'];
$Email = $_POST['Email'];
$Reason = $_POST['Reason'];
$Comment = $_POST['Comment'];
$emailaddress = $_POST['EmailAddy'];
//Email values
if (mail($emailaddress, "Contact Form",
"A contact form has been submitted from Chicago Lawyer Locator with the following information:
Name: $Name
City: $City
State: $State
Country: $Country
Email: $Email
Reason: $Reason
Comment: $Comment"
,"From: contact@chicagolawyerlocator.com")
) {
echo('<p>Mail sent successfully.</p>');
} else {
echo('<p>Mail could not be sent.</p>');
} ;
?>