|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
HTTP_REFERER
ok, got my login script, and once they login, i want to send the browser back to the page they came. Although, i have login.php which sends it to login2.php. So if i just use $HTTP_REFERER then it sends it back to login page. Is there anyway you can send it back 2 REFERERS so to speak?
|
|
#2
|
|||
|
|||
|
RE: HTTP_REFERER
hmmm...
you might want to look into javascripts history object. I think it would be something like window.history.go(-2) hth |
|
#3
|
|||
|
|||
|
RE: HTTP_REFERER
I wrote some code to do this in php once. Essentially, I wrote a function that used the array_push and array_pop functions to create a stack of pages the person has gone to in the website. And then I could redirect them back x number of pages by popping that many off the stack and using the value in header('Location: ')... No need to rely on JS.
Cheers, Keith. |
|
#4
|
|||
|
|||
|
RE: HTTP_REFERER
sounds good taoism, rekon you could share this code with us?
|
|
#5
|
|||
|
|||
|
RE: HTTP_REFERER
I've got an idea for you, this is what I did this morning...
On the login form I put a hidden input: <input type='Hidden' name='page' value='<? echo $_SERVER['PHP_SELF']; ?>'> Then in the login.php: *check login, send cookie* <html><body><head> <? if ($plain == "Login ok."){ echo "<META HTTP-EQUIV='REFRESH' CONTENT='1;URL=" .$HTTP_POST_VARS['page'] ."'>rn"; } ?> </head> <body> <? echo $plain; ?> </body> </html> That will redirect them to their last page and alow you to get the new cookie info. |
|
#6
|
|||
|
|||
|
RE: HTTP_REFERER
I havnt tried your code yet micah, but from the looks of it, it would just send them back to the page they came from. I wanted to send them back two pages
You create the hidden field in the form, and make its value $HTTP_REFERER, and then when you redirect them on the next page: so similar to yours micah, but instead of PHP self i used referer |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > HTTP_REFERER |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|