...

View Full Version : PHP Server Question - Please answer quickly



Scrowler
10-22-2003, 09:03 AM
I have localhosting setup, and when i run a script which uses $_SESSION to register the session a text ($_SESSION['s_logged_n'] = 'TRUE';)
i have debugged it by running echo with it and it comes out as null...
is this a problem with my server? should i change something in the server to allow sessions?

nicklim
10-22-2003, 09:43 AM
This is a nobrainer reply, but did you have
session_start() and
session_register('s_logged_n');?

(to check whether session is supported. try echo phpinfo(); )

Scrowler
10-22-2003, 09:46 AM
i dont need to use session_register(); and yes i have used session_start(); hence there are no error messages, it just doesnt show anything, it appears null when i echo it..

missing-score
10-22-2003, 11:51 AM
where are you trying to print the var? be aware that you must have session_start() on every page where you need to print session vars.

ConfusedOfLife
10-22-2003, 09:20 PM
What's your PHP version? Maybe it doesn't support $_SESSION and you should use $HTTP_SESSION_VARS, so, change your code from:


session_start();
$_SESSION["something"] = "somethingelse";

to


session_start();
session_register("something");
$HTTP_SESSION_VARS["something"] = "somethingelse";


It might help as it helped me once :rolleyes:

Scrowler
10-27-2003, 09:12 AM
ill try that as a last resort but i have downloaded the latest version of php so i dont think that'd be a problem :)

Spookster
10-27-2003, 03:20 PM
Do you have a temp directory set up for your sessions? And is it that path specified in your php.ini file?

Scrowler
10-28-2003, 03:32 AM
yes. also my mail() function does not work.

Spookster
10-28-2003, 04:30 AM
Are you positive your temp directory is working? Have you check it after creating a session to see if the session file is actually in there?

Scrowler
10-28-2003, 05:03 AM
the session files are all there. it just wont let me use them...

Scrowler
10-31-2003, 05:24 AM
** fixed itself **



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum