Re: Understanding session variables with input field and register_global

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux