I am trying to move data from one page to another using $_SESSION, without putting the information on a database.
This is what I have. My issue is when I have $_SESSION['first_name']='john' it passes the $_SESSION to the next page but when I have the $_POST in it will not pass the information that is put in the input. Why is it doing this? Also my register_global s is turned to off.
Thanks in advance.
This is what I have. My issue is when I have $_SESSION['first_name']='john' it passes the $_SESSION to the next page but when I have the $_POST in it will not pass the information that is put in the input. Why is it doing this? Also my register_global s is turned to off.
Thanks in advance.
Code:
<?php session_start(); $_SESSION['first_name'] = $_POST['first_nameID']; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <form name="form1" method="POST" action="testconfirm.php"> 0.<br/> <input type="text" name="first_name" id="first_nameID"/><br/><br/> <input type="submit" name="submit"/> </form> </body> </html>
Comment