jessnoonyes
10-23-2009, 10:50 PM
Hi everyone! I have a contact form that I'm trying to add fields to, but for some reason the information that's added into them isn't passed to the PHP script and mailed to me. Or perhaps there's something in the script that's messing it up. I've been playing with this for hours and I can't figure it out. Any help would be greatly appreciated!
At the top of my script I have some variables
if(!$_POST) exit;
$name = $_POST['name'];
$email = $_POST['email'];
$company = $_POST['company'];
$streetaddress = $_POST['streetaddress'];
$comments = $_POST['comments'];
$verify = $_POST['verify'];
For some reason it won't pick up the 'company' or 'streetaddress'.
My form inputs for those:
<label for="company">Company:</label>
<input name="company" type="text" id="company" size="30" value="" />
<label for="streetaddress">Street Address:</label>
<input name="streetaddress" type="text" id="streetaddress" size="30" value="" />
Further down in the script it takes the data from the form and puts it into a nice message to be emailed.
$e_reply = "Name: $name\r\n\n";
$e_email = "Email Address: $email\r\n\n";
$e_phone = "Phone Number: $phone\r\n\n";
$e_company = "Company Name: $company\r\n\n";
$e_address = "Street Address: $streetaddress\r\n\n";
$msg = $e_reply . $e_email . $e_phone . $e_company . $e_address;
I think somewhere in one of those sections I'm screwing up. It will send the message part "Company Name:" but then it's blank, no matter what I do.
Does anyone know what I'm doing wrong? Thank you for any help!
At the top of my script I have some variables
if(!$_POST) exit;
$name = $_POST['name'];
$email = $_POST['email'];
$company = $_POST['company'];
$streetaddress = $_POST['streetaddress'];
$comments = $_POST['comments'];
$verify = $_POST['verify'];
For some reason it won't pick up the 'company' or 'streetaddress'.
My form inputs for those:
<label for="company">Company:</label>
<input name="company" type="text" id="company" size="30" value="" />
<label for="streetaddress">Street Address:</label>
<input name="streetaddress" type="text" id="streetaddress" size="30" value="" />
Further down in the script it takes the data from the form and puts it into a nice message to be emailed.
$e_reply = "Name: $name\r\n\n";
$e_email = "Email Address: $email\r\n\n";
$e_phone = "Phone Number: $phone\r\n\n";
$e_company = "Company Name: $company\r\n\n";
$e_address = "Street Address: $streetaddress\r\n\n";
$msg = $e_reply . $e_email . $e_phone . $e_company . $e_address;
I think somewhere in one of those sections I'm screwing up. It will send the message part "Company Name:" but then it's blank, no matter what I do.
Does anyone know what I'm doing wrong? Thank you for any help!