18.219.156.56 |    

Navigation

Google Advertisement

referer
  1. // List of allowed domains.
  2. (array) $referers = array('newmedia24.de','tuxnet24.de');
  3.  
  4. // Go away if your referer is not in the domain list.
  5. if ( !referer($_SERVER['HTTP_REFERER']) )
  6. 	header("Location: https://www.cia.gov/");
  7.  
  8. // *****************************************************************
  9. // This function check if the $ENV{'HTTP_REFERER'} can access this page.
  10.  
  11. function referer ( $referer ) {
  12.  
  13. global $referers;
  14. if ( !empty( $referer ) ) {
  15. 	foreach ( $referers as $host ) {
  16. 		if ( preg_match( "/https?:\/\/([^\/]*)$host/i", $referer ) ) { return True; break; }
  17. 	}
  18. } else return True;
  19. return False;
  20.  
  21. }
  22.  
Parsed in 0.010 seconds at 58.73 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 1 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)