Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // Back link to previous page.
- // If current page has been called by a hyperlink.
- if(isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !='') echo '<a href="'.$_SERVER['HTTP_REFERER'].'">« Go back.</a>';
- // If current page has NOT been called by a hyperlink.
- else return;
- ?>
- if(!empty($_SERVER['HTTP_REFERER']))
- {
- if(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) == $_SERVER['HTTP_HOST'])
- {
- echo '<a href="'.htmlentities($_SERVER['HTTP_REFERER']).'">« Go back.</a>';
- }
- }
Add Comment
Please, Sign In to add comment