Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
bluedookies

tep_session_register problem

Recommended Posts

I have been struggling with something all weekend. I thought it was the contrib I started using but literally I can have the following code in one source file:

 

tep_session_register('customer_is_guest');

if (!tep_session_is_registered('customer_is_guest')){

echo 'FOOBAR' . !tep_session_is_registered('customer_is_guest');

}

 

It will printout 'FOOBAR1' - How is that possible? Anyone with insight - it would be TREMENDOUSLY appreciated!

 

Thank you in advance,

Mike

Share this post


Link to post
Share on other sites

I tried the same code and it works.

:huh:

 

Change this line:

 

tep_session_register('customer_is_guest');

To:

 

if ( !tep_session_register('customer_is_guest') ) {
  echo '<br>Failed to register variable!<br>';
}

That includes a check to let you know if the register was successful or not.

 

The code you have just assumes it was successful.

:blush:


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites
tep_session_register('customer_is_guest');

Did you set the variable $customer_is_guest ?

Otherwise just use the superglobal $_SESSION['customer_is_guest']. Works fine too.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×