PX : code

PHP Examples by Dave
Download this code


Sample code from website:

<?php
function is_proxy$ip ) {
  return 
detect_proxy_by_header() || detect_proxy_by_google$ip );
}

function 
detect_proxy_by_google$ip ) {
  
$web_page http_get(
    
"http://www.google.ca/search?q=%22$ip%22+intitle%3A%22proxy%22" );

  return 
substrstrstr$web_page"Results" ), 080 );
}

function 
detect_proxy_by_header() {
  return isset( 
$_SERVER['HTTP_X_FORWARDED_FOR'] ) ||
         isset( 
$_SERVER['HTTP_PROXY_CONNECTION'] ) ||
         isset( 
$_SERVER['HTTP_FORWARDED'] ) ||
         isset( 
$_SERVER['HTTP_XONNECTION'] ) ||
         isset( 
$_SERVER['HTTP_VIA'] ) ||
         isset( 
$_SERVER['HTTP_CLIENT_IP'] ) ||
         isset( 
$_SERVER['CLIENT_IP'] ) ||
         isset( 
$_SERVER['HTTP_FROM'] );
}
?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.