在发送此表单时,我看到“提交的表单无效。请尝试重新提交。”错误和输入未更新。
action=‘’没问题。请看重要的部分,中间的php代码,我找不到这方面的问题。
<!-- INCLUDE overall_header.html -->
<form id="wideoptions" action='' method='post'>
<input type="wide_main" id="wide_main" name="config[wide_main]" size="30" value="{WIDE_MAIN}" />
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
</form>PHP:
<?php
global $db, $user, $auth, $template, $cache;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
page_header('Wide Options');
$template->set_filenames(array(
'body' => 'wide_options.html',
));//重要的部分在这里
if (isset($_POST['submit']))
{
if (!check_form_key('acp_widecpanel'))
{
trigger_error('FORM_INVALID');
}
// request_var should be '' as it is a string ("1, 2, 3928") here, not an integer.
set_config('wide_main', request_var('wide_main', '0'));
trigger_error($user->lang['RT_SAVED'] . adm_back_link($this->u_action));
}
$template->assign_vars(array(
'WIDE_MAIN' => $config['wide_main'],
));
page_footer();
?>发布于 2014-07-10 15:16:05
表单的名称必须与add_form_key中使用的名称匹配。您在表单创建过程中使用过add_form_key吗?
https://stackoverflow.com/questions/24583134
复制相似问题