I'm not a good PHP-Programmer Just started to read, but i think the failure is
in session_register($user)(PAGE1) you register the content of user and not the variable user isnt it ?
In page 2 its ok.
Nicola wrote:
Ok I'll try my best what I'm doing
I have 2 page page1 and page2
in page1 I create a variable that is an instance of an object called user
user is a stupid object to hold 2 values name and loggedin no methods nothing .
so in page1 I do:
include("php/user.inc");
$user=new user("theuser",true,1);
session_register($user);
rest of the page here.....
in page2 I do:
include("php/user.inc");
session_register("user");
echo($user->name);
from page one I have a link to page2 and from page2 I have a link back to page1
here what's happening
the first time I go from page1 to page2
the $user->name is empty so I click back to page1 and $user->name is there I go back to page2 and guess what the $user->name is there.
why the first time I go from page1 to page2 is not $user->name is not there ?
Am I doing something totally wrong?
thank you
Nicola