|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
registering session
Hi guys,
I am wondering is there any easier/faster way for me to register the variables in a session. my code: if($login_check >0){ while ($row = mysql_fetch_array($sql)) { //user inserted username session_register('username'); $_SESSION['username'] = $username; //get data from db $last = $row['last_login']; session_register('last'); $_SESSION['last'] = $last; $status = $row['status']; session_register('$status'); $_SESSION['status'] = $status; mysql_query("UPDATE info SET last_login = now() WHERE username = '$username'"); include "main.php"; } Hope you guys can give me some idea about the alternative ways to perform such tasks. Thank you. |
|
#2
|
|||
|
|||
|
This is not needed.
PHP Code:
simply using the $_SESSION[] global array will work just fine ![]() you could simply your code as well. PHP Code:
hope it helps ps. I would read Laidbak's post on Register Globals http://www.devarticles.com/forum/sh...=&threadid=4391
__________________
-- Jason |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > registering session |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|