Hello people. I have a problem with my cart redirecting to the previous page i was looking at.
Example: You can try this yourself. My website is Anyway, i click a product or i click the shopping cart image for a product....if you're not logged in, it will prompt for logging in....Cool, but lets say i was looking at a products description, when i click the cart and log in, the page does not go back to the page i was looking at. Instead, it takes me to the registration page showing me my account info.
The code is as follows, if anyone can follow it:
Of course i have
<? ob_start();
session_start();
the code that does the work is:
$login_required=array("profile"=>1, "order_history"=>1);
if ($w=="basket")
include "./main.php";// include "./basket.php";
elseif (isset($login_required[$w])&&!@$_AUTH)
{
$w="login";
include "./main.php";
}
elseif ($w=="item_info")
{
include "blok/meta.php";
include "./main.php";
//include "blok/item.php";
}
else
include "./main.php";
//code added for deletion of old recent view data start
$q_recent="delete from recentview where vdate< NOW()";
$db->query($q_recent);
//code added for deletion of old recent view data end
?>
Now, im not sure if there is a way to redirect to the last page viewed, but if there is, can someone or anyone give me an axample of how this should work? Or can you explain how to get the user to now redirect to the cart since he/she has opted to place item in the cart?
Thanks.
Example: You can try this yourself. My website is Anyway, i click a product or i click the shopping cart image for a product....if you're not logged in, it will prompt for logging in....Cool, but lets say i was looking at a products description, when i click the cart and log in, the page does not go back to the page i was looking at. Instead, it takes me to the registration page showing me my account info.
The code is as follows, if anyone can follow it:
Of course i have
<? ob_start();
session_start();
the code that does the work is:
$login_required=array("profile"=>1, "order_history"=>1);
if ($w=="basket")
include "./main.php";// include "./basket.php";
elseif (isset($login_required[$w])&&!@$_AUTH)
{
$w="login";
include "./main.php";
}
elseif ($w=="item_info")
{
include "blok/meta.php";
include "./main.php";
//include "blok/item.php";
}
else
include "./main.php";
//code added for deletion of old recent view data start
$q_recent="delete from recentview where vdate< NOW()";
$db->query($q_recent);
//code added for deletion of old recent view data end
?>
Now, im not sure if there is a way to redirect to the last page viewed, but if there is, can someone or anyone give me an axample of how this should work? Or can you explain how to get the user to now redirect to the cart since he/she has opted to place item in the cart?
Thanks.