Hi,
I am very very new to web programming and I want to retain data once the form is submitted. I tried other says but no luck. Could someone point it out for me please?
I am very very new to web programming and I want to retain data once the form is submitted. I tried other says but no luck. Could someone point it out for me please?
Code:
<?php
session_start(); // Start the session where the code will be stored.
?>
<html>
<head>
<title>Securimage Test Form</title>
</head>
<body>
<?php
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>
<?php
} else { //form is posted
echo "<center>Sorry, the code you entered was invalid. <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>";
if (isset($_POST[username])) return $_POST[username];
}
?>
</body>
</html>
Comment