×

Welcome to TagMyCode

Please login or create account to add a snippet.
2
0
 
0
Language: PHP
Posted by: Massimo Zappino
Added: Jan 29, 2011 5:20 PM
Views: 466
  1. function getReferer($default = null)
  2.     {
  3.         if (isset($_SERVER['HTTP_REFERER'])) {
  4.             return $_SERVER['HTTP_REFERER'];
  5.         } else {
  6.             if ($default) {
  7.                 return (string) $default;
  8.             } else {
  9.                 return '';
  10.             }
  11.         }
  12.     }