Hi,
I am trying to hack into the code on a shopping cart script I bought (phpcart):
http://www.phpcart.net
I am trying to get the script to retain the cart contents if a visitor adds products to the cart then decides they want to finish shopping another day.
I have NO idea how to do this, I found a post on their message board, but the board isnt very active and I cant get a reply.
They told me this much:
phpCart uses PHP Sessions to track visitors. It then stores only one piece of information about the visitor in the session, a unique id. This unique id is called sessionid but had no relationship to an actual php session.
If you look at the top of phpcart.php you'll see the following:
session_start();
$sessionid = $_SESSION["sessionid"];
if ($sessionid == ""){
$sessionid = md5 (uniqid(rand()));
session_register(sessionid);
}
If you modify this to store the $sessionid in a cookie and then also check to see if the cookie exists you can preserve the unique id between visits.
I'll leave the rest up to you for know.
Any help would be GREATLY appreciated 🙂