Community Add-Ons

Add file to this package
Top » Features

Login and Return to same page
for osCommerce Online Merchant v2.2

This allows User's to log in and return to the page they were asked to login for, not being sent back to index.php

Open application top paste at bottom before ?>



// if the customer is not logged on, set the page to return to upon login

if ( (basename($PHP_SELF) != FILENAME_LOGIN) && (basename($PHP_SELF) != FILENAME_LOGOFF) && (!strstr($PHP_SELF,'create')) && (!strstr($PHP_SELF,'popup')) {

$navigation->set_snapshot();

}


**************************************

Open Logout.php
Place anywhere

if (sizeof($navigation->snapshot) > 0) {

$origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);

$navigation->clear_snapshot();

$link = $origin_href;

} else {

$link = tep_href_link(FILENAME_DEFAULT);

}


******************
Thats all

Legend:  Download   Report

Expand All / Collapse All

Use this method by demoalt xp02ed 29 Jul 2010  

Please read this post as this contribute is not a good solution

http://forums.oscommerce.com/topic/237743-login-redirect-to-index-instead-of-previous-page/page__st__20

Credits to the forum and posters


edit includes/application_top

// navigation history
if (tep_session_is_registered('navigation')) {
if (PHP_VERSION < 4) {
$broken_navigation = $navigation;
$navigation = new navigationHistory;
$navigation->unserialize($broken_navigation);
} elseif (!is_object($navigation)) {
$navigation = new navigationHistory;
}
} else {
tep_session_register('navigation');
$navigation = new navigationHistory;
}
$navigation->add_current_page();

Please read forum for full info

Attached file is nothing

Use this contrib on your own risk! RusNN 4 May 2010  
Login and Return to same page AndreN 3 May 2010  
Updated full pack luckyno 12 Dec 2009  
Small Fix: faaliyet 9 Dec 2009  
Fix Error trikinuke 9 Dec 2009  
Login and Return to same page Van Loco Gunther 19 Apr 2005  
Login and Return to same page Joma Webdesign 18 Apr 2005