Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Redirect after signin


Platinum Games

Recommended Posts

hello all, i am just wondering about the redirect back to last page after the login or create an account has been done. from memory i thought the shop redirected you back to the last page that you were on after you signed in or created an account (admin does after login) for some reason this is not happening in my store anymore. is this just a simple think i may have changed without realising that i have done it.

 

its a bit annoying when it redirects you back to the index page every time.

 

thanks.

Thanks in advance!

 

Ben

Link to comment
Share on other sites

done by the $navigation class

 

on login.php its:

 

	   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();
	  tep_redirect($origin_href);
	} else {
	  tep_redirect(tep_href_link(FILENAME_DEFAULT));
	}

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

do i just copy and past where i need it???

 

ok i have found the code and it seems ok, how do i change it so it redirects back to last page?

 

my code

		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();
	  tep_redirect($origin_href);
	} else {
	  tep_redirect(tep_href_link(FILENAME_DEFAULT));
	}

Thanks in advance!

 

Ben

Link to comment
Share on other sites

do i just copy and past where i need it???

 

ok i have found the code and it seems ok, how do i change it so it redirects back to last page?

 

my code

		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();
	  tep_redirect($origin_href);
	} else {
	  tep_redirect(tep_href_link(FILENAME_DEFAULT));
	}

 

 

code in apptop:

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

Thanks in advance!

 

Ben

Link to comment
Share on other sites

  • 4 weeks later...

The problem is when we run page login.php, system also change the previous page as login page in application_top.php; I did below change and find it works well in my site

 

find this in application_top.php

 

if (PHP_VERSION < 4) {

$broken_navigation = $navigation;

$navigation = new navigationHistory;

$navigation->unserialize($broken_navigation);

}

else {

$navigation = new navigationHistory;}

 

and replace with (only read color added)

 

if(basename($PHP_SELF)!=FILENAME_LOGIN){

if (PHP_VERSION < 4) {

$broken_navigation = $navigation;

$navigation = new navigationHistory;

$navigation->unserialize($broken_navigation);

}

else {

$navigation = new navigationHistory;}

}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...