ID: 14785 Comment by: [EMAIL PROTECTED] Old Reported By: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Session related Operating System: Debian Linux PHP Version: 4.1.0 New Comment:
This is not a Bug. All variables that you plan to register must be global! Reason: The PHP-function session_register() only 'remember' the *names* of the variables (not the content) it must save when the script terminates. The session vars are read at script end. This happens outside of any function or methode and therefor only global vars that have been set have a value; all others are unset. Previous Comments: ------------------------------------------------------------------------ [2002-01-01 01:18:46] [EMAIL PROTECTED] session_register() doesnt seem to save anything in functions, eg. session_start(); function bob() { $var = "somethinghere"; session_register("var"); } bob(); echo session_encode(); the above only registers the var name, not the data in it. if it helps theres a way around it, all you gota do is make the $var global so instead of having $var have $GLOBALS['var'] and it works fine. might be little bug, but it stuffed me up 4 nights in a row. oh and the way i compiled php was just with apt-get install php4 in debian, (newbie here) ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14785&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]