Trouble w/ single page form
Posted: Sat Nov 13, 2010 12:03 pm
I know I must be missing something simple here...but this form never passes the input from the field, so it always shows the form rather than showing as done. What am I missing?
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if (isset($field)) {
?>
<p>Done</p>
</body>
</html>
<?php
die();
}
else
?>
<form action="<?php echo $_SERVER[PHP_SELF]; ?>" method="POST" >
<input type="text" name="field" />
<input type="submit" value="Submit" />
</form>
<?php echo $field ?>
</body>
</html>