Page 1 of 1

PHP SESSION TRACKING

Posted: Wed Aug 22, 2007 4:39 am
by ivanstojkovic
I have one question. I have one system. In this system you can go to one page where you have to fulfill the contract form. There are 5 fields for example. In one of those the person, who fulfills the form, have to insert the name of one member. If the member does not exist. This person get an link where he/she have to enter data for new member. When he/she entered the data for new member he should be automaticly redirected to "contract form" (that is the first form that i have mentioned).
One thing more ... there is also a link "enter new member" on which you can click without fulfilling the "first mentioned form".

So the question... how can i track where i came from?

Which logic and system would you use?

Posted: Wed Aug 22, 2007 5:26 am
by Ollie Saunders
how can i track where i came from?
Conditionally generate stuff.

Code: Select all

if ($userExists) {
   echo '<a href="newuser.php">New user</a>';
} else {
   // choose a user
}
Which logic and system would you use?
The only "logic system" you can really use is to control the URLs that the users see and the actions that are performed from accessing those URLs. Only use sessions where you really must.

Posted: Wed Aug 22, 2007 5:29 am
by ivanstojkovic
You did not understand me. I know how to show some link or not. But the problem coms how redirect one page to certain location. I have described my situation.

Posted: Wed Aug 22, 2007 5:36 am
by volka
Dou already have some kind of session? Are those users logged in?

Posted: Wed Aug 22, 2007 7:06 am
by Ollie Saunders
how redirect one page to certain location

Code: Select all

header('Location: http://yourdomain.com/place.php');