|
The solution to practice 5 is the following:
(Note: What you had to type is in bold)
<h2>Simple Form Example</h2>
<? function show_form($first="",$last="") { ?>
<form action="simpleForm.php3" method="post">
First Name:
<input type=text name=first value="<?echo $first?>">
<br>
Last Name:
<input type=text name=last value="<?echo $last?>">
<br>
<input type=submit>
</form>
<? }
if(!isset($first)) {
show_form();
}
else {
if(empty($first) or empty($last)) {
echo "You did not fill in all the
fields, try again<p>";
show_form($first,$last);
}
else {
echo "Thank you, $first $last";
}
}
?>

edseries@nbcs.rutgers.edu
|