vk api

Discussion in 'PHP' started by Winst0n, 12 Jul 2010.

  1. Winst0n

    Winst0n Elder - Старейшина

    Joined:
    19 Aug 2008
    Messages:
    92
    Likes Received:
    5
    Reputations:
    0
    PHP:
    $uid $_GET[viewer_id];
    $api_id =  api_id_тут;
    $method "secure.getBalance";
    $random rand(10000,99999);
    $timestamp time();
    $v "2.0";
    $api_secret "api_secret_тут";

    $sig=md5("api_id=".$api_id."method=".$method."random=".$random."timestamp=".$timestamp."v=".$v.$api_secret);

    print 
    file_get_contents("http://api.vkontakte.ru/api.php?api_id=".$api_id."&uid=".$uid."&v=".$v."&method=".$method."&timestamp=".$timestamp."&random=".$random."&sig=".$sig);
    выдает

    изменяю
    $method = "secure.getBalance";
    на
    $method = "secure.getAppBalance";
    убираю из print file_get_contents("..."); &uid=".$uid." и показывает то что надо...
    что не так ?
     
  2. bjong

    bjong Elder - Старейшина

    Joined:
    26 Jul 2003
    Messages:
    41
    Likes Received:
    12
    Reputations:
    18
    Code:
    $uid = $_GET[viewer_id];
    на
    Code:
    $uid = $_GET['viewer_id'];
    Правильно, secure.getAppBalance не требует uid :)
    Ну а когда убираешь ошибка и вовсе пропадает ))