boris_hu Posted January 5, 2005 Posted January 5, 2005 I tried to write some php page outside osCommerce catalog directory. Suppose it is a.php /htdocs/catalog/index.php /htdocs/mydir/a.php catalog/index.php has a link to a.php. Now my problem is: at a.php, how can I get the session variables from index.php, such as customer_id, etc? I have tried session_name('osCsid'); session_start(); echo "customer_id: " . $customer_id . " from sessions. " <br>"; It doesn't work. crying.gif Any tips? Thanks a lot.
Mark Evans Posted January 6, 2005 Posted January 6, 2005 First off make sure there is something in the session to see by adding the following to your page. <?php echo "<pre>"; print_r($_SESSION); echo "</pre>"; ?> That should dump the data from the session to the screen. If that gives data in its output then look at the tep_customer_greeting() function in general.php to see how we do it. Mark Evans osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops) --------------------------------------- Software is like sex: It's better when it's free. (Linus Torvalds)
boris_hu Posted January 6, 2005 Author Posted January 6, 2005 First off make sure there is something in the session to see by adding the following to your page. <?php echo "<pre>"; print_r($_SESSION); echo "</pre>"; ?> That should dump the data from the session to the screen. If that gives data in its output then look at the tep_customer_greeting() function in general.php to see how we do it. <{POST_SNAPBACK}> Thanks a lot for your reply. It is empy output in a.php. :(
Recommended Posts
Archived
This topic is now archived and is closed to further replies.