2
我正在構建基於iframe的 - facebook應用程序。我的問題是,無論何時將用戶重定向到任何頁面,我都可以看到頁面加載了兩次。 (首先,它顯示沒有css的頁面,然後再次用css加載頁面)。我發佈任何表單時也是如此。facebook應用程序 - 一切都發布兩次 - 基於iframe的應用程序
因此,每個表單都發布兩次。數據爲每個動作添加兩次。此外,我可以在url中看到我的所有POST數據... Facebook正在將所有會話數據傳遞給URL。這是正常的嗎?
我錯過了什麼嗎?請幫幫我。以下是我的代碼。
foreach($records as $product_list)
{
?>
<tr>
<td width="250">
<form name="frm_product_<?php echo $product_list->product_id; ?>" id="frm_product_<?php echo $product_list-> product_id; ?>" action="cart.php">
<?php echo $product_list->product_name; ?><br />
Price : <?php echo $product_list->price; ?> SGD<br />
<input type="hidden" name="product_id" value="<?php echo $product_list->product_id; ?>" />
<input type="submit" name="btn_submit_<?php echo $product_list->product_id; ?>" id="btn_submit_<?php echo $product_list->product_id; ?>" value="Add to Cart" />
<input type="hidden" name="action" value="add" />
</form>
</td>
</tr>
<tr>
<td> </td>
</tr>
<?php
}
?>
if(isset($_REQUEST['action']) && $_REQUEST['action']=='add')
{
$cart = new Cart($db);
$cart->user_id = 1;
$cart->product_id = $_REQUEST['product_id'];
$cart->qty = 1;
$cart->add_to_cart1(); //this is adding items two times
}
在此先感謝。
很難說什麼導致你的雙輸出/ CSS問題,但我可以回答你的問題網址中的數據。 「