为什么发布到我的可湿性粉剂页面模板会产生404?

时间:2011-03-15 作者:Brett

嘿,伙计们。。。。。我有一个自己制作的页面模板&;我也在贴到上面去处理表格。。。。最初它工作得很好,但我移动了一些代码&;现在由于某种原因它不起作用了。它只是因为某种原因重定向到404页??

不确定这是否重要,但这是模板文件中的代码。。

/*
Template Name: Detailed Quote
*/

// Make paths up

include(ABSPATH . \'/includes/dq-config.php\');
include(ABSPATH . \'/includes/functions.php\');
include(ABSPATH . \'/includes/classes/class.detailedQuote.php\');

// Instantiate new detailedQuote class
$quote = new detailedQuote();

if (isset($_POST[\'process\'])) {

    // Prepare post data
    $data = $quote->prepare_quote_data($_POST);

    try {
        // Error check submission
        $quote->error_check_quote($data);
    } catch (Exception $e) {
        // Display output with error message
        $quote->displayOutput($e->getMessage());
        return false;
    }

} else {

    // Display page output
    $quote->displayOutput();

}
非常感谢!

1 个回复
最合适的回答,由SO网友:TheDeadMedic 整理而成

WordPress同时监听$_GET$_POST 解析请求时。如果表单输入名称与本机查询参数冲突,您将发送WordPress进行白费力气的搜索(最有可能的结果是404)。

为了方便您,我在这里列出了它们——如果您的表单输入中有任何一个使用它们作为名称,那就是麻烦制造者。

Array
(
    [0] => m
    [1] => p
    [2] => posts
    [3] => w
    [4] => cat
    [5] => withcomments
    [6] => withoutcomments
    [7] => s
    [8] => search
    [9] => exact
    [10] => sentence
    [11] => debug
    [12] => calendar
    [13] => page
    [14] => paged
    [15] => more
    [16] => tb
    [17] => pb
    [18] => author
    [19] => order
    [20] => orderby
    [21] => year
    [22] => monthnum
    [23] => day
    [24] => hour
    [25] => minute
    [26] => second
    [27] => name
    [28] => category_name
    [29] => tag
    [30] => feed
    [31] => author_name
    [32] => static
    [33] => pagename
    [34] => page_id
    [35] => error
    [36] => comments_popup
    [37] => attachment
    [38] => attachment_id
    [39] => subpost
    [40] => subpost_id
    [41] => preview
    [42] => robots
    [43] => taxonomy
    [44] => term
    [45] => cpage
    [46] => post_type
)

结束

相关推荐