Re: session/form no longer work after upgrade

From: Date: Thu, 08 Aug 2002 09:23:18 +0000
Subject: Re: session/form no longer work after upgrade
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-111618@lists.php.net to get a copy of this message
on 08/08/02 6:05 PM, Petre Agenbag (internet@vsa.co.za) wrote: > action_page > session_start(); > session_register("username","password"); > check $_POST["username_form"] and $_POST["password_form'] > if they have content, > $username = $_POST["username_form"] and $password = > $_POST["password_form"]; > <a href="another_page">here</a> you have to establish what $username and $password are before you register them to the session: action_page session_start(); check $_POST["username_form"] and $_POST["password_form'] if they have content, $username = $_POST["username_form"] and $password = $_POST["password_form"]; session_register("username","password"); <a href="another_page">here</a> Incidently, I'd be using: action_page session_start(); check $_POST["username_form"] and $_POST["password_form'] if they have content, $_SESSION['username'] = $_POST["username_form"] $_SESSION['password'] = $_POST["password_form"] <a href="another_page">here</a> ... rather than session_register(). From here, "another_page" should try to echo $_SESSION['username'] & $_SESSION['password'] to make sure you're able to maintain session. > another_page > session_start(); > <form> > variable -> another_action_page > </form> > > another_action_page > session_start(); > echo $_POST["variable"]; this has nothing to do with your session... you don't seem to be calling any session variables ($_SESSION[...]), or registering any new ones. I don't understand why you have this second form, and what it has to do with your sessions. Take small steps. Try to isolate the problem by getting rid of any noise from the script (eg the second form, heaps of HTML formatting, etc. Try and get the basic session working, then bring the noise back in, testing as you go. Justin French

« previous php.general (#111618) next »