2

我正在开发一个 facebook 画布应用程序当我单击链接时,它必须打印 testid 并查看根据 index.php 上的代码从 url 获取的变量

https://apps.facebook.com/gayriciddi/

索引.php:

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

print_r($fbme);
$access_token = $facebook->getAccessToken();

//records users to database
create_user($fbme, $access_token); 

$view = empty($_GET['view']) ? 'home' : $_GET['view'];

$controller = 'page';

echo '<br />'.$view;

$testid = $_REQUEST['testid'];

echo '<br />'.$testid.'<br />';

switch($view){

    case 'home':
        $testler = select_tests();   
    break;

    case 'acilis':

    break;

    case 'sayfa':

    break;

    case 'kapanis':

    break;
}

//includes $view.php  $view is home, acilis, sayfa or kapanis
include(WEBSITE_ROOT.'/views/'.$controller.'.php');
?>

主页.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?>index.php?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>

如果您查看我在顶部给出的链接,则定义了所有变量。当我单击链接时,它必须根据 index.php 上的代码打印 testid 并查看从 url 获取的变量

$view = empty($_GET['view']) ? 'home' : $_GET['view'];

$controller = 'page';

echo '<br />'.$view;

$testid = $_REQUEST['testid'];

但事实并非如此。也许它有非常简单的解决方案,但我找不到它。

另一方面,当我在原始 url (http://www.olmasigereken.com/gayriciddi/) 中做同样的事情时,它会按预期打印 $view 和 $testid。

4

0 回答 0