我需要使用像我的wordpress插件header('Location: http://location.com');
或header("Content-disposition: attachment; filename=$fileName");
PHP頭,但它似乎不怎麼樣。我知道他們需要在頁面頭被調用之前使用,所以我嘗試使用init鉤子:WordPress的 - 如何使用PHP頭()函數
add_action('init', 'test');
function test() {
header('Location: http://location.com') ;
}
但它沒有工作。
它怎麼沒有用?任何錯誤? – 2013-02-24 11:54:31