Guest Posted July 19, 2004 Posted July 19, 2004 I am new to PHP and osCommerce and I am losing my SID if a user clicks a link that takes them to "OTHER" pages on my site. When they click the link BACK to the /catalog/index.php they lose the session ID they originally got when they first got there. I need the HTML tag format (syntax) that I need to append to the links to keep the SID alive and well if they go to the "out of cart pages" and return. Pleeeeeeeeeeeeeeeeease help :) :) :) Ken
AJRYAN Posted July 20, 2004 Posted July 20, 2004 Hi Ken: You need to make sure that you are using tep_href_link for your links, i.e.: <u><a href="' . tep_href_link("glossary.php") . '">' . "A " . '</A></u> Try that and see if that works for you. good luck. Art
Guest Posted July 20, 2004 Posted July 20, 2004 ART, Thank you for your reply :) I think that I am having a syntax problem though. Do I need to enclose this string within a PHP Tag? ie; <?php ............. ?> Maybe an example using the Page <a href="catalog.html"> would help me so I see the exact syntax? Can you use my html page in your example? I apologize if I sound stupid I am a decent VB coder and know nothing about PHP and osCommerce. I wish I had more time to learn PHP before this site needed to be up :( I will soon tho. Thanks for everything Ken
Acheron Posted July 20, 2004 Posted July 20, 2004 The syntax depends on where you are trying to put it. Take this example ... $this = '<a href="' . tep_href_link('pagename.html') . '">' . 'Click here' . '</a>' It's all very basic HTML just wrapped in a little PHP. ;) If you check /catalog/includes/functions/general.php and /catalog/includes/functions/htmloutput.php, you can see the syntax of the most-used osC functions. For example, tep_href_link which contains various components which are seperated by commas in usage to determine the properties of the link.
AJRYAN Posted July 20, 2004 Posted July 20, 2004 Hi Ken: I really can't add anymore to what Acheron has said. He pretty well nails it. What I normally do since the syntax is a bit of a pain in the ykw, is to copy and paste what I need then plug-in/edit page names etc. This makes things much faster and are less likely to be prone to error. Hope this helps. Take care. Art
Acheron Posted July 20, 2004 Posted July 20, 2004 Here's the syntax of tep_href_link: tep_href_link($page = '', $parameters = '', $connection, $add_session_id, $search_engine_safe) Default values are: $page = '' $parameters = '' $connection = 'NONSSL' $add_session_id = true $search_engine_safe = true This means exactly what it sounds like. If you leave those fields empty, they will assume those values. So ... function tep_href_link('mypage.html') will use SIDs and a Non-SSL connection. function tep_href_link('mypage.html', '', 'SSL', false) would NOT use SIDs and WOULD use an SSL connection.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.