Răsfoiți Sursa

Updated getIP.php so it will ignore errors

adolfintel 8 ani în urmă
părinte
comite
ee004fd2d0
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      getIP.php

+ 3 - 0
getIP.php

@@ -4,8 +4,11 @@
 	Output from this script is a JSON string composed of 2 objects: a string called processedString which contains the combined IP, ISP, Contry and distance as it can be presented to the user; and an object called rawIspInfo which contains the raw data from ipinfo.io (will be empty if isp detection is disabled).
 	Output from this script is a JSON string composed of 2 objects: a string called processedString which contains the combined IP, ISP, Contry and distance as it can be presented to the user; and an object called rawIspInfo which contains the raw data from ipinfo.io (will be empty if isp detection is disabled).
 	Client side, the output of this script can be treated as JSON or as regular text. If the output is regular text, it will be shown to the user as is.
 	Client side, the output of this script can be treated as JSON or as regular text. If the output is regular text, it will be shown to the user as is.
 */
 */
+error_reporting(0);
 $ip = "";
 $ip = "";
 header('Content-Type: application/json; charset=utf-8');
 header('Content-Type: application/json; charset=utf-8');
+header('Access-Control-Allow-Origin: *');
+header('Access-Control-Allow-Methods: GET, POST');
 if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
 if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
     $ip = $_SERVER['HTTP_CLIENT_IP'];
     $ip = $_SERVER['HTTP_CLIENT_IP'];
 } elseif (!empty($_SERVER['X-Real-IP'])) {
 } elseif (!empty($_SERVER['X-Real-IP'])) {