Guest Posted June 8, 2005 Posted June 8, 2005 Hi guys My plan is to keep a user logged in, even when they navigate out of OSC directories. Therefore, I need to keep the sessions active? Could somebody point me in the right direction as to where to start. I've got some idea's... thanks from sunny Cornwall, UK :blush: Dan
FalseDawn Posted June 8, 2005 Posted June 8, 2005 Use the tep_href_link() function which will add the session ID to the URL if needed.
Guest Posted June 8, 2005 Posted June 8, 2005 thanks you for your reply, that kind of makes sense, but 'learner' / 'not learn enough' here. can you give me a bit more information please
FalseDawn Posted June 8, 2005 Posted June 8, 2005 Well, when you say "navigate out of OSC", you are going to have to provide a link for them to click on, to take them to an "external" page, yes? All I'm saying is, don't hard-code the link - build it using a call to the function. You can link to HTML pages as long as the client accepts cookies, as the session will be stored client-side, otherwise you will need to use php pages and the tep_href_link() function. In fact, probably better not to try to use html pages at all.
♥Vger Posted June 8, 2005 Posted June 8, 2005 If you already have a lot of html pages and don't want to lose their content, but want them to blend with your osCommerce php pages then do this: Take a root level php page like conditions.php and rename it. Remove this from the head section: require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS); Change this: $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONDITIONS)); to this: $breadcrumb->add('new page name here'); After the head section strip out left and right columns (if you don't want them), but I'd suggest leaving the header and footer in place (for compatibility). Then, where you see this: <tr> <td class="main"><?php echo TEXT_INFORMATION; ?></td> </tr> change it to this: <tr> <td class="main"><?php include ('htmlpagename.html'); ?></td> </tr> Then put the html page of the same name in the root of your website. You don't need to add the new php page to includes/filenames.php, your main page content will all be html, but you'll keep the session id. Vger
Guest Posted June 8, 2005 Posted June 8, 2005 i'm sorry, but i'm really confused by that example above, and afriad to try it, the site (development) is located here http://dengate.amplifeyesolutions.com/
FalseDawn Posted June 8, 2005 Posted June 8, 2005 Maybe you are confused by this "Take a root level php page like conditions.php and rename it." would be better as: "Take a root level php page like conditions.php, copy it to a new file and then rename it." You are only adding stuff, you do not need to change anything akready there.
♥Vger Posted June 8, 2005 Posted June 8, 2005 Take a root level php page like conditions.php, copy it to a new file and then rename it. When you open conditions.php (or any other file) and select 'Save As' and choose another name then the page you have on screen will be the new page. The old page (conditions.php) will still be there on your computer, unedited. Vger
Guest Posted June 8, 2005 Posted June 8, 2005 i done exactly what you said, and it didn't work, as soon as i navigate out of /catalog/ back to the sites root directory, i'll lose the sesions, meaning, when i return to /catalog/ i have to sign in again sorry i've i seem thick as two planks, i'm trying, honest
aapinen Posted July 24, 2006 Posted July 24, 2006 this worked only for one html-page. e.g page1.html. But if you put a hyperlink from page1.html to page2.html it doesnt stay "inside" the osc anymore. Could this be a way to make a forum (phpbb) "inside" the osc too? If you already have a lot of html pages and don't want to lose their content, but want them to blend with your osCommerce php pages then do this: Take a root level php page like conditions.php and rename it. Remove this from the head section: require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS); Change this: $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONDITIONS)); to this: $breadcrumb->add('new page name here'); After the head section strip out left and right columns (if you don't want them), but I'd suggest leaving the header and footer in place (for compatibility). Then, where you see this: <tr> <td class="main"><?php echo TEXT_INFORMATION; ?></td> </tr> change it to this: <tr> <td class="main"><?php include ('htmlpagename.html'); ?></td> </tr> Then put the html page of the same name in the root of your website. You don't need to add the new php page to includes/filenames.php, your main page content will all be html, but you'll keep the session id. Vger
Recommended Posts
Archived
This topic is now archived and is closed to further replies.