@@ -10,27 +10,27 @@ |
||
| 10 | 10 | public function validateipActionGet($ipAdress = null, $accessKey = null) : string |
| 11 | 11 | { |
| 12 | 12 | |
| 13 | - // $url = "apikey.json"; |
|
| 14 | - // $data = file_get_contents("http://" . $_SERVER["HTTP_HOST"] . "/dbwebb/ramverk1/me/redovisa/src/IpValidators/apikey.json"); |
|
| 15 | - // $keytest = json_decode($data); |
|
| 16 | - // |
|
| 17 | - // |
|
| 18 | - // $accessKey = $keytest->api_key; |
|
| 19 | - // echo $accessKey; |
|
| 13 | + // $url = "apikey.json"; |
|
| 14 | + // $data = file_get_contents("http://" . $_SERVER["HTTP_HOST"] . "/dbwebb/ramverk1/me/redovisa/src/IpValidators/apikey.json"); |
|
| 15 | + // $keytest = json_decode($data); |
|
| 16 | + // |
|
| 17 | + // |
|
| 18 | + // $accessKey = $keytest->api_key; |
|
| 19 | + // echo $accessKey; |
|
| 20 | 20 | |
| 21 | 21 | |
| 22 | - // http://api.ipstack.com/79.138.27.9?access_key=ae68fdd7e0843f6cbbaf81475db34e24 |
|
| 23 | - $curlh = curl_init('http://api.ipstack.com/'.$ipAdress.'?access_key='.$accessKey.''); |
|
| 24 | - curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true); |
|
| 22 | + // http://api.ipstack.com/79.138.27.9?access_key=ae68fdd7e0843f6cbbaf81475db34e24 |
|
| 23 | + $curlh = curl_init('http://api.ipstack.com/'.$ipAdress.'?access_key='.$accessKey.''); |
|
| 24 | + curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true); |
|
| 25 | 25 | |
| 26 | 26 | |
| 27 | - $json = curl_exec($curlh); |
|
| 28 | - curl_close($curlh); |
|
| 27 | + $json = curl_exec($curlh); |
|
| 28 | + curl_close($curlh); |
|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | |
| 33 | - return $json; |
|
| 33 | + return $json; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | // http://api.ipstack.com/79.138.27.9?access_key=ae68fdd7e0843f6cbbaf81475db34e24 |
| 23 | - $curlh = curl_init('http://api.ipstack.com/'.$ipAdress.'?access_key='.$accessKey.''); |
|
| 23 | + $curlh = curl_init('http://api.ipstack.com/' . $ipAdress . '?access_key=' . $accessKey . ''); |
|
| 24 | 24 | curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true); |
| 25 | 25 | |
| 26 | 26 | |