Hey Guys,
I'm going crazy trying to figure this out. I'm making a request form that when you fill it out, emails the values to me. I'm just testing it right now to make sure it works but for some reason whenever I get it to spit the value back to me, it keeps giving me a 0 for the width and I can't figure out why.
The HTML is :
<form action="requestquote.php" method="post">
Material: <select name="materials">
<option value=""></option>
<option value="absoluteblackjet">Absolute Black Jet</option>
<option value="angolablack">Angola Black</option>
<option value="bonaccordimpala">Bon Accord/Impala</option>
<option value="galaxystar">Galaxy Star</option>
<option value="maduragold">Madura Gold</option>
<option value="tanbrown">Tan Brown</option>
</select>
<p>
Worktop Peiece:
<p>
Peiece 1
<p>
Width: <input type="text" name="worktopwidth" value="" size="5" maxlength="5" />
Length: <input type="text" name="workleng" value="" size="5" maxlength="5" />
<p>
Email: <input type="text" name="email" value="" size="20" />
<p>
<input type="submit" />
<input type="reset" />
</form>
and the php page it's referencing is:
$materials = $_REQUEST["materials"];
$workwidth = (int)$_REQUEST["workwidth"];
$workleng = (int)$_REQUEST["workleng"];
$email = $_REQUEST["email"];
$to = "**********";
$subject = "Mailer Test";
$message = "$materials, $workwidth, $workleng, $email";
$headers = "From: $email";
echo $materials;
echo "<br />";
echo $workwidth;
echo "<br />";
echo $workleng;
echo "<br />";
echo $email;
echo "<br />";
$execute_statement = "INSERT INTO quoats(materials, workwidth, workleng, email) VALUES('$materials','$workwidth','$workleng', '$email')";
mysql_query($execute_statement) or die ('Error executing SQL statement!!! Cant Add Values2');
$sent = mail($to, $subject, $headers, $message);
if($sent==true) {print "Your mail was sent successfully"; }
else {print "We encountered an error sending your mail"; }
It seems to be emailing fine and inserting the info into the Database with no problem, just no value for width.
Any help would be really appreciated!