Jump to content

Recommended Posts

session_start() needs to be called before you use a session variable.  Doesn't matter if it's inside or outside of a function.  session variables are already global.  If you assign something to a session variable without (or before) calling session_start(), it will act like a normal global variable for that page, but will not persist to other pages.

Instead of c/p'ing it here and asking if it will work, you could always c/p it to a test.php and run it and find out.

 

1. I didn't copy, I wrote it real quick.

2. I didn't ask if it would work, I just made a statement before marking the topic as solved.

 

Wes

hmm I coulda swore I saw a question mark in there, hence the statement. My bad.  But for argument sake, for #1, I meant it in a more generic sense.  As in, if you're going to take the time to put it in one place, why not just put it in another place, click the proverbial run button and see what happens?

hmm I coulda swore I saw a question mark in there, hence the statement. My bad.  But for argument sake, for #1, I meant it in a more generic sense.  As in, if you're going to take the time to put it in one place, why not just put it in another place, click the proverbial run button and see what happens?

 

10-4. I wasn't offended ;)

 

Wes

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.