Hi,
If i wanted to be able to re-direct someone back to the page they originally came from by passing the original page url through the url itself (the address bar) how would i set a variable as the current page url? what would the code look like?
Thanks.
passing page url through url
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Code: Select all
//calling_page.php:
echo "<a href='called_page.php?return_to=" . urlencode($_SERVER[REQUEST_URI]) . "'>Go</a>";
// called_page.php
// do processing....
$return_to = $_GET['return_to'];
if(empty($return_to)) {
$return_to = "default_location.php";
}
header("Location: " . strtr($return_to, "\r\n", " "));