Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php session_start(); function getUserIP() { $client = @$_SERVER['H..
Decoded Output download
<?php
session_start();
function getUserIP()
{
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = $_SERVER['REMOTE_ADDR'];
if(filter_var($client, FILTER_VALIDATE_IP))
{
$ip = $client;
}
elseif(filter_var($forward, FILTER_VALIDATE_IP))
{
$ip = $forward;
}
else
{
$ip = $remote;
}
return $ip;
}
$ip2 = getUserIP();
$details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip2 . ""));
if ($details && $details->geoplugin_countryCode != null) {
$countrycode = $details->geoplugin_countryCode;
$_SESSION['countrycode1'] = $countrycode;
}
$details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip2 . ""));
if ($details && $details->geoplugin_countryName != null) {
$countryname = $details->geoplugin_countryName;
$_SESSION['country1'] = $countryname;
}
$details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip2 . ""));
if ($details && $details->geoplugin_city != null) {
$countrycity = $details->geoplugin_city;
$_SESSION['countrycity'] = $countrycity;
}
?>
Did this file decode correctly?
Original Code
<?php
session_start();
function getUserIP()
{
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = $_SERVER['REMOTE_ADDR'];
if(filter_var($client, FILTER_VALIDATE_IP))
{
$ip = $client;
}
elseif(filter_var($forward, FILTER_VALIDATE_IP))
{
$ip = $forward;
}
else
{
$ip = $remote;
}
return $ip;
}
$ip2 = getUserIP();
$details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip2 . ""));
if ($details && $details->geoplugin_countryCode != null) {
$countrycode = $details->geoplugin_countryCode;
$_SESSION['countrycode1'] = $countrycode;
}
$details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip2 . ""));
if ($details && $details->geoplugin_countryName != null) {
$countryname = $details->geoplugin_countryName;
$_SESSION['country1'] = $countryname;
}
$details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip2 . ""));
if ($details && $details->geoplugin_city != null) {
$countrycity = $details->geoplugin_city;
$_SESSION['countrycity'] = $countrycity;
}
?>
Function Calls
getUserIP | 1 |
session_start | 1 |
Stats
MD5 | f9041f219d42a2402a2dfae31c65a820 |
Eval Count | 0 |
Decode Time | 45 ms |