Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>LOKATOR</title>
- <style>
- @import url('https://fonts.googleapis.com/css?family=Roboto');
- body, html {
- font-family: 'Roboto';
- height: 100%;
- width: 100%;
- padding: 0;
- margin: 0;
- overflow: hidden;
- }
- .ip_address {
- width: 30%;
- margin: 0 auto;
- text-align: center;
- background-color: #9dbcc5;
- padding: 3em;
- border-radius: 10px;
- color: #fff;
- font-size: 1.5em;
- }
- .wrapper {
- height: 100%;
- width: 100%;
- display: flex;
- align-items: center;
- }
- </style>
- </head>
- <body>
- <div class="wrapper"><div class="ip_address">
- <?php
- $IParray = array_values(array_filter(explode(',',$_SERVER['HTTP_X_FORWARDED_FOR'])));
- $ip = end($IParray) ? end($IParray) : $_SERVER['REMOTE_HOST'];
- echo "Tvoja javna IP adresa je " . $ip . '<br /><br>';
- $drzava = json_decode(file_get_contents("http://ipinfo.io/{$ip}"));
- echo "GEO PODACI: <br>Drzava: {$drzava->country} <br>Grad: {$drzava->city} <br>Regija: {$drzava->region}";
- ?>
- </div></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement