Re: cvs: phpweb /include ip-to-country.inc

From: Date: Sun, 25 May 2003 12:27:25 +0000
Subject: Re: cvs: phpweb /include ip-to-country.inc
References: 1  Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-18071@lists.php.net to get a copy of this message
-    // Search in the database from the given index
-    $country = i2c_search_in_db($ipn, $idx);
+    // Search in the database from the given index and if not found
+    // we attempt 3 lookups in total moving the index down one.
+    while ($country == "NA" && $count < 4) {
+        $country = i2c_search_in_db($ipnum, $idx);
+        $idx--;
+        $count++;
+    }
Note Jacques that this 'fix' you applied resulted in that no IP is properly looked up. You changed the param variable name from $ipn to $ipnum, which is the dotted representation, so no IP will be found. I'll commit a fix for this shortly, as well as some code to avoid putting php.net under a very high load for no particular reason (ie searching the db three times). Goba

« previous php.mirrors (#18071) next »