0
我正在使用wp_redirect()
重定向到一個URL,但它給了我下面的警告,並沒有重定向。我應該什麼時候使用wp_redirect()
?是否有人知道wp_redirect()
是如何工作的?我需要知道什麼時候應該使用wp_redirect()?
**[Fri Feb 28 03:58:36 2014] [error] [client 127.0.0.1] PHP Warning:
Cannot modify header information - headers already sent by (output
started at /home/virgo/public_html/others/sites/wepay/wp-content/
themes/twentythirteen/header.php:43) in /home/virgo/public_html/o
thers/sites/wepay/wp-includes/pluggable.php on line 875, referer:
http://127.0.0.1/others/sites/wepay/?page_id=15**
在輸出任何內容後,您不能使用它,因爲它使用'Location'標頭髮送重定向,並且標頭出現在HTTP消息的正文之前。 – Paulpro
請參閱http://stackoverflow.com/q/7381661/2126792或http://stackoverflow.com/a/12770075/2126792。 – pschueller