Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

tep_session_register problem


bluedookies

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

Link to comment
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 >

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...