IP Info

FREE
By NeutrinoAPI.com | Updated 9 дней назад | Location
Popularity

9.3 / 10

Latency

62ms

Service Level

100%

Health Check

N/A

Back to All Discussions

cURL under PHP code returns NULL

Rapid account: Gruszka Seb
gruszka.seb
8 лет назад

Hi,
When I’m running cURL on my PHP code, it always returns NULL value. When I’m running it from shell then it’s working correctly.
My PHP code is:

data=array(ip=>162.209.106.137,reverselookup=>false);data = array('ip' => '162.209.106.137', 'reverse-lookup' => 'false'); curl = curl_init();
curl_setopt(curl,CURLOPTURL,"https://communityneutrinoipinfo.p.mashape.com/ipinfo");curlsetopt(curl, CURLOPT_URL, "https://community-neutrino-ip-info.p.mashape.com/ip-info"); curl_setopt(curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt(curl,CURLOPTPOST,1);curlsetopt(curl, CURLOPT_POST, 1); curl_setopt(curl, CURLOPT_HTTPHEADER, array(‘X-Mashape-Key: gaqUL3298fmshIcz27izfRgcMdnkp1cWtjUjsntxmpSbuS6xSP’));
curl_setopt(curl,CURLOPTSSLVERIFYPEER,false);curlsetopt(curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt(curl, CURLOPT_POSTFIELDS, data);data); result = curl_exec(curl);if(!curl); if (!result) {
echo curl_error(curl); } curl_close(curl);
var_dump(json_decode($result, true));

Rapid account: Neutrinoapi
neutrinoapi Commented 8 лет назад

Hi gruszka,
Try this PHP code snippet here: https://www.neutrinoapi.com/api/api-examples/php/
You’ll need to create a new API key here as well: https://www.neutrinoapi.com/signup/

Join in the discussion - add comment below:

Login / Signup to post new comments