Файл: index.php
Строк: 40
<?php
header('Content-Type: text/html; charset=utf-8', true);
$title = 'VKInfo v 1.0';
include_once 'head.php';
function gorod($ised=''){
$gorod = 'https://api.vk.com/method/database.getCitiesById.xml?city_ids='.$ised.'&version=5.27';
$xml= simplexml_load_file($gorod);
foreach ($xml->city as $item) {
$city= $item->name;
return $city;
}
}
echo'<div class="class"><center><form method="post" action="">
ID пользователя вконтакте:<br>
<input type="text" name="id" value="" /><br>
<input type="submit" name="go" value="Узнать" />
</form></center></div>';
/////////
if ($_POST['go']){
$id=$_POST['id'];
$responses = 'https://api.vk.com/method/users.get.xml?user_id='.$id.'&fields=photo_200_orig,city&name_case=Nom&version=5.27';
$xml= simplexml_load_file($responses);
foreach ($xml->user as $item) {
$name= $item->first_name;
$last_name= $item->last_name;
$city_id= $item->city;
$photo= $item->photo_200_orig;
echo'<div class="class"><center>
Имя: '. $name.'<br>';
echo'Фамилия: '. $last_name.'<br>';
echo'Город: '. gorod($city_id) .'<br>';
echo'Ссылка на страницу: https://vk.com/id'.$id.'</center><br>';
echo'<div id="tenja"><center><img src="'.$photo.'" alt="" /></center></div></div>';
}
};
echo '<div style="padding: 5px;">
<center>(c) by STELS_365 2015</center>
</div>
<center><small>gen: '.round(microtime(1)-$t, 4).' sec.</small></center>
</body>
</html>';
?>