Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Redirect to the Page the user vistied before


oRex

Recommended Posts

Posted

Hi,

 

i hope that there is no other thread who has a similar content. I looked through a lot of threads using the search funkction but didn't find what i was looking for.

I wanted to know if it is possible to redirect a user to a certain page he looked before. Is there already a function in OSCOMMERCE ?

 

For Example.

 

The user looked at any page. It shouldn't matter where he was. Let's say he was on anypage.php now i have written an additionial page.

The user have to got to this page to enter some more specific data. If the user now entered this data i want to redirect him to the page he came from.

Like:

User came from ANYPAGE.PHP -> had to enter the data on DATA.PHP -> know i want to redirect him to ANYPAGE.PHP

 

I hope i did explain it clear enough.

Sry if there are some mistakes in my english.

 

 

 

(has that function something to do with what i want?)

$cart->restore_contents();

	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));
	}

 

 

Thx

Posted

in data.php, you can check the referrer ($_SERVER['HTTP_REFERER']) - this should indicate that the referring page was anypage.php. depending on how you're entering your data, you could stuff the value from the referrer into a hidden input field, so when the user enters data and clicks submit, the referrer information is included. then, in the post handler, process your data and redirect to the page indicated in the hidden input field.

Archived

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

×
×
  • Create New...