Re: Understanding session variables with input field and register_global

From: Date: Tue, 20 Feb 2007 16:44:34 +0000
Subject: Re: Understanding session variables with input field and register_global
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-249099@lists.php.net to get a copy of this message
2007. 02. 20, kedd keltezéssel 17.32-kor Otto Wyss ezt írta: > I've an input field in a form > > <input name="username" type="text" ... > > and with register_global I can use this field in PHP as variable > $username. Yet if I use a session variable > > $_SESSION['username'] = 'value' > > the variable $username gets the same value. the manual says ( http://hu.php.net/manual/en/ref.session.php ) "If register_globals is enabled, then the global variables and the $_SESSION entries will automatically reference the same values which were registered in the prior session instance. However, if the variable is registered by $_SESSION then the global variable is available since the next request." that's why it is the same I think you should read the value from $_POST and put it into $_SESSION to change it hope that helps Zoltán Németh > On the other side when I > enter a value in the input field, the session variable isn't changed. So > how can I set the session variable from the input field after it has > changed? > > O. Wyss >

« previous php.general (#249099) next »