Hi there, im trying to get value from form to PHP but its not working.
<?php
if (isset($_POST['cartype'])==0)
{
echo("Please select car type.");
}
else if (isset($_POST['carcolour'])==0)
{
echo("Please select car colour.");
}
else if (isset($_POST['carenginesize'])==0)
{
echo("Please select car engine size.");
}
else if (isset($_POST['terms'])==0)
{
echo("Please agree to site terms and conditions before submitting your order.<br/>
Press the back button in your browser to try again.");
}
else{
$name=$_POST['firstname'];
$lastname=$_POST['lastname'];
$email=$_POST['emailaddress'];
$phone=$_POST['phone'];
$ctype=$_POST['cartype'];
$colour=$_POST['carcolour'];
$enginesize=$_POST['carenginesize'];
$options=$_POST['options'];
echo "Dear,"."$name"."$lastname";
echo "<br/>Thank you for your order";
echo "<br/>You're contact details are:-";
echo "Phone : "."$phone";
echo "email: "."$email";
echo "<br/>You have selected the following car:";
echo "<br/>Car type:"."$ctype";
echo "<br/>Colour:"."$colour";
echo "<br/>Engine size:"."$enginesize";
echo "<br/>Options:<br/>";
$count=count($options);
for($i=0;$i<$count;$i++)
{
echo $options[$i]."<br/>";
}
$optn=array("6 disc DVD changer",
"TV function",
"DAB digital radio",
"Loudspeaker system - professional ",
"Multimedia navigation system",
"Universal remote control",
"Voice control",
"Navigation system",
"Head-up display",
"Adaptive headlights",
"Night vision with pedestrian recognition",
"Run-flat tyres");
foreach($options as $optn)
{
echo "NEw option ".$optn."<br/>";
}
}
?>