Sunda Cyber Army


* Sunda Cyber Army 2k17 *
Indonesia Defacer ~


Path : /home/dent/public_html/apis/
File Upload :
Current File : /home/dent/public_html/apis/geocoding_api_end.php

<!doctype html>
<html>
<head>
    <title>Geocoding API Starter</title>
    </style>
</head>
<body>
<h2>Lookup Coordinates Using Address</h2>

<!-- to get user input -->
<form action="" method="post">
    Address: <input name="address" type="text"/>
    <input name="submit" type="submit" /><br><br>
</form>

<?php

// if user passes their address
if(isset($_POST["address"])){
    $address = urlencode($_POST["address"]);
}

// Define the endpoint to look up a place using an address
$url = 'https://geocode.maps.co/search?q='.$address;

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
curl_close($ch);

$data = json_decode($result, true);
$dataPhp = array();

if($data != null){
    for($i = 0; $i < sizeof($data); $i++){
        echo 'Name: ' . $data[$i]["display_name"] .
            '<br>Lattitude: ' . $data[$i]["lat"] .
            '<br>Longitude: ' . $data[$i]["lon"].
            '<hr>';
        array_push($dataPhp, array("lat" => $data[$i]["lat"], "long" => $data[$i]["lon"], "name" => $data[$i]["display_name"]));
    }
}
else{
    echo '<h4>No geocodes found</h4>';
}
?>


</body>
</html>