you want to keep the form input fields populated? is that what you mean?? because your form fields are displayed only when $_POST is empty you should break it down like so
PHP Code:
<?php session_start(); // Start the session where the code will be stored. ?>
<html>
<head> <title>Securimage Test Form</title> </head>
<body>
<?php
if (isset($_POST['submit'])) { //Error if (!$_POST['usname']) || !$_POST['code']) { echo "<center>Sorry, the code you entered was invalid. <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>"; } else { //Process } }
if (empty($_POST)) { ?>
<form method="POST" > <strong>Name:</Strong><br /> <input id="text" name="usname" /> Code:<br /> <input type="text" name="code" size="12" /><br /><br />
<input type="submit" value="Submit Form" /> </form>
</body> </html>
|