I have to create a single page form, and since I haven't done any programming in a while, I seem to be hitting a wall. Can someone tell me what I'm doing wrong here?
I want the form to display, but then after it's submitted, I want just the results to display. The code below just keeps displaying the form no matter what I try.
I want the form to display, but then after it's submitted, I want just the results to display. The code below just keeps displaying the form no matter what I try.
PHP:
<!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 name="form" method="post" action="http://www.domain.com/">
<input type="text" name="field" />
<input type="submit" value="Submit" />
</form>
</body>
</html>