heya everyone
I am having a few troubles using the session variable.
On the login page i am starting the session and assigning a value (the username) to the $_SESSION variable.
Then i am tryin to access that variable on the next page and it isnt showing it and the same on a different page. However if i change it so that instead of loading a page is the login details are correct it just display's the username from teh $_Session variable then it displayes it fine.
Can anyone help?
Frosty
session variables
Moderator: General Moderators
Re: session variables
Is session_start() on the top of every page you are trying to access the session variables?
Re: session variables
no the session_start() is only on the top of the first page i.e. the login page
Re: session variables
You need it on every page that wants to access the sessions.frosty16 wrote:no the session_start() is only on the top of the first page i.e. the login page
[url=http://php.net/session_start]PHP Manual - session_start[/url]l wrote:session_start() creates a session or resumes the current one based on the current session id that's being passed via a request, such as GET, POST, or a cookie.
Re: session variables
o brilliant thank you