提交表单后如何重定向到指定页面?
警告:无法修改标题信息-标题已由发送(输出开始于wordpress\\wp-admin\\menu-header.php:94
) 在里面wordpress\\wp-content\\plugins\\test\\test.php
在线16
<?php
/*
Plugin Name: TEST
Plugin URI: http://localhost/
Description: TEST
Version: 0.0.1
Author: TEST
Author URI: http://localhost/
*/
add_action(\'admin_menu\', \'test\');
function test() {
add_menu_page(\'test\', \'test\', 0, \'test/test.php\', \'page\');
}
function page() {
if(isset($_POST[\'submit\'])) {
header(\'Location: /index.php\');
exit;
}
echo \'<form action="" method="post"><input type="submit" value="Submit form" name="submit" /></form>\';
var_dump($_POST);
}