PHP Code Example

March 22, 2016

In PHP the integration into FraudGuard.io API is extremely easy.

The most simple method is using native PHP CURL directly.

<?php
$login = 'username';
$password = 'password';
$url = 'https://@api.fraudguard.io/ip/101.200.121.73';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "$login:$password");
$result = curl_exec($ch);
curl_close($ch);
echo($result);
?>