- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
<?php
include('config.php');
session_start();
if($_GET["code"] != null)
{
$user_code = $_GET["code"];
$api ='https://oauth.vk.com/access_token?client_id=666&client_secret=i_am_a_god&redirect_uri=http://govnosite.com/check_podp.php&code='.$user_code;
$resp = file_get_contents($api);
$data = json_decode($resp, true);
$vk_access_token = $data['access_token'];
$vk_uid = $data["user_id"];
$sql = mysql_query("SELECT `id`, `email`, `podp_id` FROM `regitr` WHERE `email`='".$_SESSION['email']."' ");
$i=1;
while($row = mysql_fetch_assoc($sql))
{
$podp[$i] = $row["podp_id"];
$resy = file_get_contents("https://api.vk.com/method/friends.areFriends?user_ids=".$podp[$i]."&v=5.37&access_token=".$vk_access_token."");
$datar = json_decode($resy, true);
$user_info = $datar['response'][0];
$result = $user_info['friend_status'];
if($result == 0 || $result == 2)
{
header("Location: ne_popd1.php");
exit();
}
else
{
$i++;
}
}
header("Location: oplata.php");
exit();
}
?>
guest 31.10.2015 07:06 # +1