ecroskey Posted July 8, 2003 Share Posted July 8, 2003 I need to set a new global variable that would come in from a link in an email. Below you will notice I have a variable called "adcode" attached to some value. I need to know how to pass this through the entire transaction and not lose it after the first click from within the site. So far including this variable does not damage the link in anyway, but once you arrive at the site and click on any other link it disappears. <a href="http://www.xxx.com/catalog/product_info.php?adcode=xxxxxx&cPath=21_24&products_id=80"> How do I capture that variable and pass it along with that customers activities until they check out? I really apreciate all the help I get here, this one happens to be a big, big, big deal to my company, so thank you very much! Best Regards, Eric Link to comment Share on other sites More sharing options...
ecroskey Posted July 8, 2003 Author Share Posted July 8, 2003 I am not exactly sure why, but I can follow the link into the site now, and when I click on "Add TO Cart" that is where my variable is being dropped. I included in application_top.php the following thinking it was a SSL (HTTPS) problem: if (isset($HTTP_GET_VARS['adcode'])) { $adcode = $HTTP_GET_VARS['adcode']; } elseif ( (getenv('HTTPS') == 'on') && isset($HTTP_GET_VARS['adcode'])) { $adcode = $HTTP_GET_VARS['adcode']; } Does this seem like I am on the right track? I really need help with this. Regards, Eric Link to comment Share on other sites More sharing options...
ecroskey Posted July 8, 2003 Author Share Posted July 8, 2003 http://www.securesci2.com/uscommgallery/ca...&products_id=56 This would be an embedded link in an email. Once you arrive at the site, you are on the product page, then you click add to cart and you go to the shopping cart page, but now when you click on checkout, it is dropping the code! Any ideas? Regards, Eric Link to comment Share on other sites More sharing options...
wizardsandwars Posted July 8, 2003 Share Posted July 8, 2003 You have to find on each page, where each link is, and code the link to include the variable that contains the parameter you wish to pass. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
ecroskey Posted July 8, 2003 Author Share Posted July 8, 2003 where would that go? Could you give me an example of where the code would or should be? I guess I don't know why it is passing through the first to pages and not continuing. Regards, Eric Link to comment Share on other sites More sharing options...
Guest Posted July 8, 2003 Share Posted July 8, 2003 The second argument to tep_href_link is the parameters string. If the second argument is missing, you just need to add it in: tep_href_link(FILENAME_SOMEFILE, ($HTTP_POST_VARS['adcode'] ? 'adcode=' . $HTTP_POST_VARS['adcode'] : '')); Similarly, if it's empty, just replace the '': tep_href_link(FILENAME_SOMEFILE, ($HTTP_POST_VARS['adcode'] ? 'adcode=' . $HTTP_POST_VARS['adcode'] : ''), "SSL"); If it is not empty tep_href_link(FILENAME_SOMEFILE, $string); then it gets a little more complicated: tep_href_link(FILENAME_SOMEFILE, ($HTTP_POST_VARS['adcode'] ? $string . '&adcode=' . $HTTP_POST_VARS['adcode'] : $string)); or something like that. Whatever the third or later arguments say, just keep them as is (if they aren't there, leave them out). Hth, Matt Link to comment Share on other sites More sharing options...
wizardsandwars Posted July 8, 2003 Share Posted July 8, 2003 I guess I don't know why it is passing through the first to pages and not continuing. Because you passed it through the first URL, but not the subsequent URLs. You have to explicitly pass the parameter through each URL, it doesn't automatically pick it up in each subsequent link. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.