<?php
// one way
if($_POST['sweets']){
if($_POST['sweets'] == "yes"){
header( 'Location: ../ilikesweets.php' )
}ELSE{
header( 'Location: ../idontlikesweets.php' )
}
}
echo "<form method=\"post\" target=\"_self\" >
do you like sweets</br>
<select name='sweets' size=\"1\">
<option></option>
<option value=\"yes\">yes</option>
<option value=\"no\">no</option>
</select>
<input type=\"submit\" />
</form>"
?>
<?php
// another way
if($_POST['sweets']){
if($_POST['sweets'] == "yes"){
include "ilikesweets.php";
}ELSE{
include "idontlikesweets.php";
}
}ELSE{
echo "<form method=\"post\" target=\"_self\" >
do you like sweets</br>
<select name='sweets' size=\"1\">
<option></option>
<option value=\"yes\">yes</option>
<option value=\"no\">no</option>
</select>
<input type=\"submit\" />
</form>"
}
?> HITMANOF44th
Posting Whiz in Training
283 posts since Apr 2009
Reputation Points: 24
Solved Threads: 33