PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 1st, 2002, 06:24 AM
D1NGO D1NGO is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Perth, Australia
Posts: 221 D1NGO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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?

Reply With Quote
  #2  
Old August 1st, 2002, 10:56 AM
EvilivE EvilivE is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Milwaukee, WI USA
Posts: 291 EvilivE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via Yahoo to EvilivE
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

Reply With Quote
  #3  
Old August 1st, 2002, 01:02 PM
Taoism Taoism is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Winnipeg, MB, Canada
Posts: 81 Taoism User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 sec
Reputation Power: 2
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.

Reply With Quote
  #4  
Old August 1st, 2002, 02:09 PM
D1NGO D1NGO is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Perth, Australia
Posts: 221 D1NGO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: HTTP_REFERER

sounds good taoism, rekon you could share this code with us?

Reply With Quote
  #5  
Old August 1st, 2002, 06:06 PM
Micah Micah is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: NC
Posts: 21 Micah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Micah
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.

Reply With Quote
  #6  
Old August 3rd, 2002, 03:30 PM
D1NGO D1NGO is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Perth, Australia
Posts: 221 D1NGO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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 i did figure it out though, so just in case anyone is interested how, i'll post it here:
You create the hidden field in the form, and make its value $HTTP_REFERER, and then when you redirect them on the next page:
php Code:
Original - php Code
  1.  
  2. header("Location: <?= $_POST['referer'] ?>

so similar to yours micah, but instead of PHP self i used referer

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > HTTP_REFERER


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway