RE: [PHP-WIN] POST & REFERER problem

From: Date: Thu, 01 Nov 2001 19:18:37 +0000
Subject: RE: [PHP-WIN] POST & REFERER problem
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-10162@lists.php.net to get a copy of this message
Right if I understand this right, then I think this should do the trick: In your href tags to the login page (say login.php) should look like this: <A HREF="login.php?came_from=A">Click to login</A> for page A and <A HREF="login.php?came_from=B">Click to login</A> for page B. Your login page will now have a variable called $came_from containing either A or B. Now you just want to test this variable and print out another href depending on what came_from is: if ($came_from=="A") print("<A HREF=\"pageA.html\">Click here to be returned</A>"); if ($came_from=="B") print("<A HREF=\"pageB.html\">Click here to be returned</A>"); Will that do? Ross -----Original Message----- From: Michel Laine [mailto:michel@systemtech.se] Sent: 01 November 2001 16:31 To: php-windows@lists.php.net Subject: [PHP-WIN] POST & REFERER problem I need some guidance on the following problem. I have a setup where the usage flow is (kinda) like this: Page A ----\ /----\ | ---- Login -+-- [done login] Page B ----/ | \ \ (back to calling page) / -------------------------------- Nice ascii art, heh? Description: I have a working session / authorization system which i want to add a feature to. A user who (either from page A or B) wants to login. The user (if not logged in allready) gets presented a loginscreen (login). To login the user POST the login & pwd to the login page (to itself) for validation. If the login is successful i want to present the user with a link back to the initial page (A or B). How can i do this? All i get from $HTTP_REFERER after the login page is - the login page. I know that i must save the reference as the login page gets called the first time, but i haven't managed to get something to work yet. Any helpful soul out there? -- Michel Laine -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net For additional commands, e-mail: php-windows-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#10162) next »