LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   php session problem with windoze (https://www.linuxquestions.org/questions/linux-general-1/php-session-problem-with-windoze-27900/)

antken 08-14-2002 09:39 AM

php session problem with windoze
 
hi,

i am experimenting in windows with some php stuff

i have this chunk of code:
<?
if (!session_is_registered('count')) {
session_register('count');
$count = 1;
}
else {
$count++;
}

?>
Hello visitor, you have seen this page <?php echo $count; ?> times.<p>

when it runs on a linux machine i get as it says above hello visitor you have seen this page x times

but when it runs on a windoze box i get: Notice: Undefined variable: count in two.php on line 27
Hello visitor, you have seen this page 1 times.
it seems that the session varibles are not working for some reason
any ideas any one?


thanks
-antken

Hans Zarkoff 08-14-2002 04:02 PM

What browser are you running in Windows? IE 6.0 runs that code just fine.

I have no idea if this will work, but change line 1 from '<?' to '<?PHP'.

Lemme know how it goes.

antken 08-14-2002 04:44 PM

yep done that ( <?php ) no error messages now but it still does not work

i dont mean the browser when i say on windows i mean the server on windows and the server on linux it works fine when hosted on a linux box and it does not work when hosted on a windows box


any ideas?

j-ray 08-15-2002 02:54 AM

as far as i know the session variables do only work with php installed as an apache module. so that canīt work on a doze or if php is installed static.
cheers, jens

antken 08-15-2002 10:08 AM

thanks for that,

so am i correct in thinking that sessions will not work correctly if php is running as a cgi, and for them to work correctly php needs to be installed as a module

j-ray 08-16-2002 05:45 AM

exactly, the session-variables are information supplied by apache
cheers, jens

antken 08-16-2002 08:28 AM

ok,

i have managed ( i think ) to get php loaded as a module, but the sessions are not working properly still, as above i am using the same chunk of code but now when the session_start(); is issued a new session start every time and i am having the same results as before but it is not giving me any notices this time

any ideas?

p.s. i am using apache 2 with the latest php version

thanks
-antken



All times are GMT -5. The time now is 03:45 PM.