Forum Moderators: coopster
Here is how is create them on the login success page
$firstname = mysql_result($sql,$i,"firstname");
$user_id = mysql_result($sql,$i,"user_id");
$_SESSION['user_id'] = "$user_id";
$_SESSION['name'] = "$firstname";
$_SESSION['member'] = true;
header("Location: index.php");
On the index page they can be printed by using:
<?php
$user_id = $_SESSION[user_id];
$name = $_SESSION['name'];
print "Welcome $name , $user_id";
?>
But on the second page that is linked to from this one the same code does not work. Neither variables are present.
What in the name of craziness am I missing.
Cheers
In the two browsers mentioned, I have to clear the cookies and voila! I get the right session back. I can't figure it out and it perplexes me that Mozilla 1.4 works but not Firefox or Netscape 7.
Tom