This is a discussion on "Sessions" within the PHP Forum section. This forum, and the thread "Sessions are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Sessions
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Sessions
Hi, im trying to start a session and print its ID but its not working.
Hers the code
Welcome to session number: Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 I don't understand what this is going on about, im using an earlier version than 4.2.3 and (4.1 something). Is there an easy way to fix this |
|
|
|
#2
|
||||
|
||||
|
Re: Sessions
try using session_id() instead of $PHPSESSID...
see here for more information http://uk2.php.net/manual/en/function.session-id.php |
|
#3
|
|||
|
|||
|
Re: Sessions
Hi, that makes it print the session ID but its still gicing the warning.
Also (and more importantly) when I add a variable to the session, how do I retrieve that variable later on on a page a couple of links ahead. Im just messing around with them so I don't have a real example but this is the sort of thing im trying to do Page 1 -> start session, add variable (Ive done this bit) Page 2 -> Just a HTML link page (doesn't need the session) Page 3 -> Only accesible from page 2, opens session (done this) and retrieves the variable value (I don't know how to do this) If the varaible is called "$name" how do I print its value on page 3, because im assuming if i just put echo"$name"; its going to look for a varaible called $name on the page and not in the session Im just doing this to help me understand how you can use sessions to save having to pass all the variables using forms. |
|
#4
|
|||
|
|||
|
Re: Sessions
Im trying to use sessions to make a login system but its not working, my code is
Does anyone know if what im doing is right, I just can't seem to get it working Last edited by djme; Feb 24th, 2006 at 22:17. |
|
#5
|
|||
|
|||
|
Re: Sessions
Ive been doing a bit of reading on the net and it seems this is important to say.
Im trying to access a session variable on a different page to where it was registered Do this mean I have to declare or access it differently to if I was just using it on that page? I want the session variable to be accessible to all pages. I still can't find what I need to do to make it work though, I read that it should be declared globally but I don't know how to do this |
![]() |
| Tags |
| sessions |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Little help on sessions? | ktsirig | PHP Forum | 0 | Mar 2nd, 2006 22:12 |
| xsl, php sessions (please help) | marco_van_mayo | Other Programming Languages | 0 | Feb 19th, 2006 14:35 |
| php sessions | fragalot | PHP Forum | 7 | Nov 8th, 2005 20:43 |
| PHP Sessions | benbacardi | PHP Forum | 5 | Aug 28th, 2005 09:29 |
| Sessions | vor | ASP.NET Forum | 3 | Aug 19th, 2003 20:10 |