It is still not working so i try to write down everything, maybe the problem in the details.
So i have 3 files so far.:
form1.html
serc.php
vwaudidiesel.html
you can check them on the hcases.co.uk site.
What i want to do.
the main page is the form1.html there is 2 drop down option if someone choos vw and diesel then the visitor be directed to --> vwaudidiesel.html
and so on... so if someone choos fiat and petrol then be directed to ---> fiatpetrol.html (fiatpetrol.html is not redy yet.
the problem at the moment:
when i do the if statment like this:
<?
$model = $_POST['model'];
$fuel = $_POST['fuel'];
if( $model == 14 && $fuel==2 ) {
echo "this is vw diesel";
}
else {
echo "something else";
}
?>
it is works fine if someone choos vw and the diesel in the menu then printed the good text but when i ty to redirect to other page like this:
<?
$model = $_POST['model'];
$fuel = $_POST['fuel'];
if( $model == 14 && $fuel==2 ) {
header('Location: http://hcases.co.uk/vwaudidiesel.html');
exit;
}
else {
echo "The if statement evaluated to false";
}
?>
It doesn't work. , only an empty page be loaded.
Here are the codes i done so fare:
form1.html
<form action="serc.php" method="post">
<select name="model">
<option value="19">Alfa Romeo</option><option value="1">BMW</option><option value="18">Chrysler</option><option value="2">Daewoo</option><option value="3">Fiat</option><option value="4">Ford</option><option value="5">Hyundai</option><option value="20">Land Rover</option><option value="6">Mercedes</option><option value="7">Mitsubishi</option><option value="8">Nissan</option><option value="9">Porsche</option><option value="10">Peugeot / Citroen</option><option value="11">Renault</option><option value="12">Rover</option><option value="17">Saab</option><option value="13">Suzuki</option><option value="14">VW / Audi / Seat / Skoda</option><option value="15">Vauxhall</option><option value="16">Volvo</option> </select></p>
<p><select name="fuel">
<option value="1">Petrol</option>
<option value="2">Diesel</option>
</select></p>
<p><input type="submit" src="img/search.jpg" name="submit" value="submit" /></p>
</div>
</form>
serc.php
<?
$model = $_POST['model'];
$fuel = $_POST['fuel'];
if( $model == 14 && $fuel==2 ) {
header('Location: http://hcases.co.uk/vwaudidiesel.html');
exit;
}
else {
echo "The if statement evaluated to false";
}
?>
I dont post the vwaudidiesel.html it is to large. you can check it on the hcases.co.uk/vwaudidiesel.html
Thanks for any help.