Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Question about Session

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Question about Session

Postby xboy » Mon Oct 07, 2002 11:24 pm

Hi all,

can anyone please help me with my session problem? I'm currently using PHP4.2.2 with Apache on Redhat 8.0.

Whenever I try to use session, it doesn't seem to work.. following is the sample code I use and the result printed out is always 1 no matter how many time I refresh..

<?php

session_start();
session_register('count');
$count++;
echo "<p>You've been here $count times. Thanks!</p>";

?>

I use phpinfo() to checked and found out that session is enable.... what have I done wrong?? thank you very much...
xboy
New php-forum User
New php-forum User
 
Posts: 5
Joined: Mon Oct 07, 2002 11:20 pm

Postby DoppyNL » Tue Oct 08, 2002 1:36 am

I think you're problem is allready described here:
http://www.php-forum.com/p/viewtopic.php?t=318

Greetz Daan
DoppyNL
 

Postby Jay » Tue Oct 08, 2002 3:21 am

Try this instead
Code: Select all
<?
session_start();
$_SESSION['count']++;
print "<p>You've been here {$_SESSION['count']} times. Thanks!</p>";
?>
Jay
 

Postby xboy » Tue Oct 08, 2002 6:00 pm

Thanks guys for advice :)
xboy
New php-forum User
New php-forum User
 
Posts: 5
Joined: Mon Oct 07, 2002 11:20 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.