Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session variables problem?

Status
Not open for further replies.

safra

Technical User
Jan 24, 2001
319
NL
Hi,

In one web site I have to sections that use session variables.

In the first section it is working fine. In the second section however it doesn't although I use the same approach. I can't figure out where the problem is.

at the top of the page I use:
<?
start_session();
?>

then in the page:

<?
session_register($ownerID);
$ownerID = $myrow[&quot;id&quot;];
?>

when testing it in the same page, the value of $ownerID is correct.

In the next page, I put this on top:
<?
start_session();
?>

testing the value of $ownerID results in nothing?

Any ideas what is going wrong and is there a way to test if the variable is stored in the session?

Thanks,
Safra
 
you should use
session_register(&quot;$ownerID&quot;);

PAY ATTENTION AT THE EXPLICATION MARKS!
 
Sorry I did a mistake!
It should be:
session_register(&quot;ownerID&quot;);

WITHOUT THE DOLLAR SIGN.

Now we got it .. I hope ;)

 
Thanks Bimmel that worked!

I was being stupid as the reason why I thought it did work in the other section was because the same variable is passed through a form.

Ron

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top