Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have been writing a login script for a site, upon execution of the
code I recieved this error:

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


not quite fully understanding the error message I wrote a simpler
session script (below) I get a parse error on the session_register
line. Assuming the code is correct I take it the session isn't being
initilised correctly? if not how can I get around this issue?


echo 'session started';

$username = 'paul'

echo '"paul" has been stored in the session.';


thank you.

Re: sessions

paul wrote:

Quoted text here. Click to load it

  this is okay.

Quoted text here. Click to load it

  you shouldn't be using this any more.  the preferred way to do things with
sesions nowadays is to use the $_SESSION super-global array:

  $_SESSION['username'] = $username;

Quoted text here. Click to load it

  echo " has been stored in the session.";

  good ruck.

I am not an ANGRY man.  Remove the rage from my email to reply.

Site Timeline