-1

ファンページではなく、Facebookのiframeアプリケーションを使用しています。
このコードを使用すると、うまく印刷されます

 $signed_request = $facebook->getSignedRequest();
 print_r($signed_request);

印刷します:

Array (   
[algorithm] => HMAC-SHA256   
[expires] => 1341475200   
[issued_at] => 1341470027     
[oauth_token] =>...  
[user] =>   
   Array (    
         [country] => tr   
         [locale] => en_US   
         [age] => Array ( [min] => 21 )  
         )   
         [user_id] => ...  
       )

しかし、アドレスバーのURLを変更してhttps://apps.facebook.com/myappname/?app_data=helloEnterキーを押すと、配列にapp_data=helloパラメーターが出力されません。どうすれば印刷できますか?


私のアプリケーションはiframeアプリです。この写真を見てくださいあなたは私のアプリhttp://apps.facebook.com/gayriciddi/に行き、ホームページのリンクをクリック して見ることができます

$view = empty($_GET['view']) ? 'home' : $_GET['view'];
    echo '<br />'.$view; 
    $testid = $_REQUEST['testid'];
    echo '<br />'.$testid.'<br />';

コードは機能しているかどうか

私のindex.php:

<?php
    include ('config.php');
    include ('db_fns.php');
    header('Content-type: text/html; charset=UTF-8'); 

    print_r($fbme); 

    $controller = 'page';

    $view = empty($_GET['view']) ? 'home' : $_GET['view'];
    echo '<br />'.$view; 
    $testid = $_REQUEST['testid'];
    echo '<br />'.$testid.'<br />';

    $signed_request = $facebook->getSignedRequest();
    print_r($signed_request);

    //includes home.php
    include(WEBSITE_ROOT.'/views/'.$controller.'.php');
?>

私のhome.php:

    <table width="601" border="0">
 <?php foreach($testler as $key => $test){?>
  <tr>
    <td width="53">&nbsp;</td>
    <td width="420"><a href="<?=FB_BASE_URL?>?view=acilis&testid=<?=$test['id']?>" target="_top"><?php echo $test['ad'];?></a></td>
    <td width="50">&nbsp;</td>
    <td width="50">&nbsp;</td>
  </tr>
 <?php } ?>
</table>
4

1 に答える 1

0

$ _GET ['app_data']は、ページタブのように署名されたリクエストの一部ではないため、使用するだけです。

于 2012-07-05T11:00:07.250 に答える