<?php
// Read the selected language.
$language = ($_REQUEST['language']);
// make the language array.
$language=array(1=>'Malay','English','Chiness','India');
// make the language pull-down menu.
echo'<select name="language">';
foreach($language as $key =>$value) {
echo"<option value=\"$key\">$value</option>\n";
}
echo '</select>';
// Validate the gender.
if (isset($_REQUEST['language'])) {
$language = ($_REQUEST['language']);
if ($language == 'Malay') {
$message = '<P><b>Good day, Sir!</b></p>';
} else ($language == 'English') {
$message = '<P><b>Good day, Madam!</b></p>';
} else ($language == 'Chiness') {
$message = '<P><b>Good day, Madam!</b></p>';
} elseif ($language == 'India') {
$message = '<P><b>Good day, Madam!</b></p>';
} else { // Unacceptable value.
$message = NULL;
echo '<p><font color="red">You forgot to enter your name!</font></p>';
}
}else { //$_REQUEST['gender'] is not set.
$language = NULL;
echo '<p><font color="red">You forgot to enter your name!</font></p>';
}
?>
<form action="choose.php" method="post">
<br/>
<input type="submit" value="GO!"/>
</form>
</body>
</html>