SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Complicated referrer
Hybrid View
-
Sep 10, 2001, 10:37 #1
Complicated referrer
Is there a function like in php like this javascript function:
history.back();
If a user access one of my pages, I want a link back to his exact previous page. So if the user comes from:
thread.php?threadid=3
the link back has to be "thread.php?threadid=3"
any ideas?
-
Sep 10, 2001, 10:50 #2
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Did you try $HTTP_REFERER;
I did this simple test
test1.php
PHP Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<a href="test2.php">go there</a>
</body>
</html>
PHP Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<a href="<?=$HTTP_REFERER?>">go back</a>
</body>
</html>
I clikced on the link to go to test2.php and the back link contained http://localhost/test1.php?var=1
which I think is what you want.Please don't PM me with questions.
Use the forums, that is what they are here for.
-
Sep 10, 2001, 10:56 #3
Thanx!
I tought $HTTP_REFERER turns out in test1.php instead of test1.php?var=1...
didn't test it
thanx anyway!
Bookmarks