This PHP snippet can help you let users jump directly to the page they visited before after logging in
- function current_url()
- {
- $url = "http://" . $_SERVER['HTTP_HOST'] . $ _SERVER['REQUEST_URI'];
- $validURL = str_replace("&", "&", $url);
- return validURL;
- }
Copy code
Usage:
- echo "Currently you are on: ".current_url();
- ?>
Copy code
|