Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

problem with new session variable


bmarker

Recommended Posts

How do I create a session variable in one page and pull it up on another?

the traditional way is not working...

I have tried

session_register('varname');

$varname = "varVal";

 

and

 

$_SESSION['varname'] = "varval";

 

and

 

tep_session_register('varname');

$varname = varVal;

 

but don't know how to recall it on another page.

Any help would be VERY appreciated.

Link to comment
Share on other sites

you are likely executing the same code again. You should do

 

  if( !tep_session_is_registered('my_session_var') ) {
tep_session_register('my_session_var');
$my_session_var = 10;
 }

 

and so on another script simply use the session variable

 

echo $my_session_var;

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...