All pastes #424850 Raw Edit

Mine

public php v1 · immutable
·published 2007-04-05 01:28 UTC
rendered paste body
$ip=getenv("HTTP_X_FORWARDED_FOR");$start = mysql_query("SELECT rangestart FROM banned_ip_ranges WHERE rangestart <= '".$ip."' AND `rangeend` >= '".$ip."'");  $end = mysql_query("SELECT rangeend FROM banned_ip_ranges WHERE rangestart <= '".$ip."' AND `rangeend` >= '".$ip."'");  if(($start != FALSE) && ($end != FALSE)) { }  else  {  $res1 = mysql_result($start,0);  $res2 = mysql_result($end,0);   print "<center>You are in range : $res1 <--> $res2 </center><BR>";  $banned_ip = array($res1,$res2);  } $min = ip2long($banned_ip[0]); $max = ip2long($banned_ip[1]);