Question about Session

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
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...

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

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>";
?>

xboy

Tue Oct 08, 2002 6:00 pm

Thanks guys for advice :)

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests