Hi,
I have a form with a textbox and A submit button. I want the value of the textbox to be stored in a variable so as to pass through to other pages.
I have reached this point:
page 1
<?php
session_start();
if (isset($_POST['txtusername']))
$_SESSION['test'] = $_POST['txtusername'];
?>
<!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=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="page2.php">
<input type="submit" name="Submit" value="Submit" /></a>
<input type="text" name="txtusername" />
</form>
</body>
</html>
page2
<?php
session_start();
echo $_SESSION['test'];
?>
<?php echo $_SESSION['test']; ?>
Unfortunately, the opening page is blank...I don't know what to do...please, help me