Page 1 of 1

[PHP] Storing a link

Posted: Sat Dec 09, 2006 9:39 am
by thiscatis
I'm currently working on a shopping cart system for a school project and one of group members pointed out an inconvenience.
When you add a product to your basket your redirected to a registration page to create an account (with your personal basket).
This is how the system should work. (I'd prefer cookie storage and when registered to a database, but hey, i'm not the teacher).
Anyway.. imagine you're browsing in a rather large store for a product, you finally got it and then you press "add to basket" and you need
to register, once registered you have to do the search process all over again. In a marketing way, this is not good.
So is there a way to store the "came from" link over a few pages?

1. So user is on a certain page [this is the url that needs to be stored]
2. User clicks on add product, is redirected to register.php
3. User registers (register function is in functions.php)
4. When registered he is redirected to the register_success.php page
5. And from here he should be able to be redirected to the url from step one.

Anyone?

Posted: Sat Dec 09, 2006 9:46 am
by feyd
store it in a session variable.

Posted: Sat Dec 09, 2006 10:01 am
by thiscatis
Could you point me in the right direction with some starting code or a structure?

Posted: Sat Dec 09, 2006 10:03 am
by feyd
:?

Code: Select all

$_SESSION['someName'] = $url;

Posted: Sat Dec 09, 2006 10:04 am
by thiscatis
aah, sorry :)