Jump to content

Variables


ghostta

Recommended Posts

When people log into my site by clicking submit, they are passed to a authenitcation page which if they pass directs them to the internal site.  What I would like to do is have a few variables that are global across all the logged in pages they access like their company logo and name.  How do I do this?  I tried $GLOBALS['xxx'] but it doesn't seem to stick beyond the page they are assigned.

Link to comment
https://forums.phpfreaks.com/topic/201758-variables/
Share on other sites

Ya, I thought about sessions.  But the other problem I had with sessions is the across all the pages I could access my session variables like $_SESSION['xxx'] but if I tested for the session id like session_id() == "" that would always come back true.  Is it possible to have sesssion_id() return an empty string but still access $_SESSION['xxx']?  I was worried there was an underlying bigger problem that would affect me down the road.

Link to comment
https://forums.phpfreaks.com/topic/201758-variables/#findComment-1058314
Share on other sites

I had two function that did it for me.  The auth page would call the function that would start the sesssion and register the vars.  The page it directed you to would then call the check function which would do:

 

if ( session_id() == "" )

 

But that would always result in true.

Link to comment
https://forums.phpfreaks.com/topic/201758-variables/#findComment-1058322
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.