2016-03-05 182 views
0

我在當前頁面http://localhost/checkout/purchase-confirmation/?payment_key=97de4a39e2a8c732e686d7414ff5951a刷新頁面被點擊

<form method="POST" action=''> 
    <input type="submit" name="deliver_confirmation" value=" Tôi đã nhận được đồ. Tôi đồng ý trả tiền cho Người Mua Hộ"> 
</form> 

當它被點擊有一個按鈕,它像發送電子郵件,更新數據庫。 然後最後,頁面刷新。

if (isset($_POST['deliver_confirmation'])) 
{ 
//Update payment meta of deliver_status 
    $meta['deliver_status']= 'Đã giao hàng'; 
    edd_update_payment_meta($payment->ID, '_edd_payment_meta', $meta);?> 
//Refresh page 
    <meta http-equiv='refresh' content='0;"<?php get_permalink($payment->ID); ?>"'> 
}     
?> 

的問題是,後頁面刷新,它會被重定向到

http://localhost/checkout/purchase-confirmation/" 

這是未找到頁面錯誤。我不知道重定向網址的字符來自何處"

有沒有更好的方法來刷新頁面?也許添加一些JavaScript,或者等等等等......

回答

0

試試這個

<?php 
echo '<META http-equiv="refresh" content="0;URL='.get_permalink($payment->ID).'">'; 

?> 
+0

這不起作用。它被重定向到http:// localhost /?post_type = edd_payment&p = 7800 – John

0

您可以實際使用header()代替:

header (Location: get_permalink($payment->ID)); 

另外,如果你想使用meta refresh ,它應該是:

echo "<meta http-equiv='refresh' content='0; url=" . get_permalink($payment->ID) . "'>";