LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-14-2002, 09:39 AM   #1
antken
Member
 
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
Question 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
 
Old 08-14-2002, 04:02 PM   #2
Hans Zarkoff
Member
 
Registered: Apr 2002
Location: Canada
Distribution: Slackware
Posts: 58

Rep: Reputation: 15
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.
 
Old 08-14-2002, 04:44 PM   #3
antken
Member
 
Registered: Nov 2000
Posts: 368

Original Poster
Rep: Reputation: Disabled
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?
 
Old 08-15-2002, 02:54 AM   #4
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
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
 
Old 08-15-2002, 10:08 AM   #5
antken
Member
 
Registered: Nov 2000
Posts: 368

Original Poster
Rep: Reputation: Disabled
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
 
Old 08-16-2002, 05:45 AM   #6
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
exactly, the session-variables are information supplied by apache
cheers, jens
 
Old 08-16-2002, 08:28 AM   #7
antken
Member
 
Registered: Nov 2000
Posts: 368

Original Poster
Rep: Reputation: Disabled
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


Last edited by antken; 08-16-2002 at 09:44 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Are PHP session variables held in memory when you leave a PHP site? Locura Programming 11 11-16-2008 08:37 PM
PHP Session problem!!! AskMe Programming 9 06-03-2004 07:33 AM
RH9: PHP session problem (or Apache problem) fengcn Red Hat 0 12-01-2003 06:32 PM
php session problem niehls Programming 3 06-20-2002 11:51 AM
php on windoze j-ray General 2 05-27-2002 11:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration