Hello,
When I try to retrieve data that inserted to the text area, it didn't keep the value.
Here's the code (the retrieve function is bold)
<html>
<head>
<title>A BASIC HTML FORM</title>
<?PHP
$username = $_POST['username'];
if (isset($_POST['Submit1']))
{
$username = $_POST['username'];
if ($username == "myFriend")
{
print ("Welcome back, friend!");
}
}
else
{
$username="";
}
?>
</head>
<body>
<FORM NAME ="form1" METHOD ="POST" ACTION = "http://localhost/try3.php">
<INPUT TYPE = 'TEXT' VALUE ="<?PHP print $username;?>" NAME ='username'>
<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Login">
</FORM>
</body>
</html>
How to keep data that the user entered?
Moderator: General Moderators
Re: How to keep data that the user entered?
is this the first time someone enters in a username? or do you have them stored on a database?
Is this like a 'remember me' function of a user log in?
Is this like a 'remember me' function of a user log in?