Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

saving session variables


utahfriend

Recommended Posts

Posted

I am setting up affilates to sell our products. When someone comes from the affiliate's website, there is a code that is passed by "GET" value. I want to save that value to a session value so that when they make an order, the value is added to the database. However, I cannot get the variable to save to a session variable. The code I put in the index.php files is as follows:

if ($_GET['affiliate']) {
  $value=$_GET['affiliate'];
  $_SESSION['affiliate']=$value;
}

 

Any and all help is appreciated!

Posted

Try this:

 

if ($_GET['affiliate']) {
  $value=$_GET['affiliate'];
  if ( ! tep_session_is_registered('affiliate') ) 
     tep_session_register('affiliate');
}

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 >

Archived

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

×
×
  • Create New...