配置表单phpbb



发送此表单时,我看到'提交的表单无效。再试一次。"错误,输入未更新。

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();
?>

表单的名称必须与add_form_key中使用的名称匹配。您是否在创建表单时使用了add_form_key ?

https://wiki.phpbb.com/Function.add_form_key

https://wiki.phpbb.com/Function.check_form_key

最新更新