CorfuVBProgrammer Posted December 14, 2006 Share Posted December 14, 2006 Hello all . . .I have PHP Session problem in my PC.My Computer :Windows XP with SP2IIS Web ServerPHP 5.2The Problem :I have create to web pages :PAGE1 -> index.php------------------------------------------------------------------------<?phpsession_register();$_SESSION['name'] = "Merianos Nikos";?><html><head><title></title></head><body><?phpecho $_SESSION['name'];?><a href="index2.php">Click Me</a></body></html>------------------------------------------------------------------------PAGE2 -> index2.php------------------------------------------------------------------------<?phpsession_register();echo $_SESSION['name'];?><html><head><title></title></head><body></body></html>------------------------------------------------------------------------When i start the index.php page it work correctly and the result is the following------------------------------------------------------------------------Merianos Nikos [url=http://Click Me]Click Me[/url]------------------------------------------------------------------------Then if i click on the [url=http://Click Me]Click Me[/url] to go on the index2.phpthe result is the following------------------------------------------------------------------------PHP Notice: Undefined variable: _SESSION in C:\Inetpub\wwwroot\PHP_TEST\index2.php on line 4------------------------------------------------------------------------So what can i do for ? ? ?I have try many many thinks and still i have the same problem.Also i have try to use session_start() instead of session_register() and nothing thange . . .Please i need help . . .Thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/30616-resolved-session-problem/ Share on other sites More sharing options...
trq Posted December 14, 2006 Share Posted December 14, 2006 You using session_register() when you should be using session_start().PS; I changed your title to something with a little more thought. Quote Link to comment https://forums.phpfreaks.com/topic/30616-resolved-session-problem/#findComment-140985 Share on other sites More sharing options...
CorfuVBProgrammer Posted December 14, 2006 Author Share Posted December 14, 2006 It doesn't work none of them.Only the session_register() let me show the session variable in the index.php but i can't transfer it to index2,php Quote Link to comment https://forums.phpfreaks.com/topic/30616-resolved-session-problem/#findComment-140986 Share on other sites More sharing options...
trq Posted December 14, 2006 Share Posted December 14, 2006 session_register() has long been depricated and never did what your trying to do with it anyway.If your getting an undefined variable error than php is not setup to handle sessions, how did you install php? Quote Link to comment https://forums.phpfreaks.com/topic/30616-resolved-session-problem/#findComment-140987 Share on other sites More sharing options...
CorfuVBProgrammer Posted December 14, 2006 Author Share Posted December 14, 2006 When i using the session_start() i have the following result:Merianos NikosClick Me PHP Warning: session_start() [function.session-start]: open(C:\DOCUME~1\E456~1\LOCALS~1\Temp\php\upload\sess_vshiukg8ldedh8mcdlk81vanu7, O_RDWR) failed: No such file or directory (2) in C:\Inetpub\wwwroot\PHP_TEST\index.php on line 2 PHP Warning: Unknown: open(C:\DOCUME~1\E456~1\LOCALS~1\Temp\php\upload\sess_vshiukg8ldedh8mcdlk81vanu7, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\DOCUME~1\E456~1\LOCALS~1\Temp\php\upload) in Unknown on line 0 Quote Link to comment https://forums.phpfreaks.com/topic/30616-resolved-session-problem/#findComment-140988 Share on other sites More sharing options...
trq Posted December 14, 2006 Share Posted December 14, 2006 Please verify that the current setting of session.save_path is correct. Quote Link to comment https://forums.phpfreaks.com/topic/30616-resolved-session-problem/#findComment-140990 Share on other sites More sharing options...
CorfuVBProgrammer Posted December 14, 2006 Author Share Posted December 14, 2006 My session.save_path = C:\DOCUME~1\E456~1\LOCALS~1\Temp\php\session so i changed to C:\Documents and Settings\Μέριανος Νίκος\Local Settings\Temp\php\session And the poblem still exists Quote Link to comment https://forums.phpfreaks.com/topic/30616-resolved-session-problem/#findComment-140994 Share on other sites More sharing options...
trq Posted December 14, 2006 Share Posted December 14, 2006 Is that directory readable/writable?Did you restart the server? Quote Link to comment https://forums.phpfreaks.com/topic/30616-resolved-session-problem/#findComment-140996 Share on other sites More sharing options...
CorfuVBProgrammer Posted December 14, 2006 Author Share Posted December 14, 2006 My Friend you are the best . . .Thank you a lot . . . ! ! ! !I had only to make the folder accesible from the IISI really thank you a lot . . . :D Quote Link to comment https://forums.phpfreaks.com/topic/30616-resolved-session-problem/#findComment-140999 Share on other sites More sharing options...
trq Posted December 14, 2006 Share Posted December 14, 2006 Glad to hear it. Next time, a little more patience please. Franticly announcing that you need help will usually get you knowhere. Quote Link to comment https://forums.phpfreaks.com/topic/30616-resolved-session-problem/#findComment-141000 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.