From ce5987030ac93ed6be423591c4f5e3277c44dd0f Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Mon, 6 Jan 2014 22:30:02 -0500 Subject: [PATCH] port ip2locationlite to curl --- ip2locationlite.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ip2locationlite.class.php b/ip2locationlite.class.php index 7ea2f2f..f04b0dd 100644 --- a/ip2locationlite.class.php +++ b/ip2locationlite.class.php @@ -1,4 +1,6 @@ service . '/' . $this->version . '/' . $name . '/?key=' . $this->apiKey . '&ip=' . $ip . '&format=xml'); + $url = 'http://' . $this->service . '/' . $this->version . '/' . $name . '/?key=' . $this->apiKey . '&ip=' . $ip . '&format=xml'; + $ch =curl_init($url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + $xml = curl_exec($ch); + curl_close($ch); + //$xml = @file_get_contents('http://' . $this->service . '/' . $this->version . '/' . $name . '/?key=' . $this->apiKey . '&ip=' . $ip . '&format=xml'); if (get_magic_quotes_runtime()){