首页 > 解决方案 > 表单重定向到同一页面,但显示不存在

问题描述

您好,我对 html 表单有一个非常奇怪的问题。我正在使用 Wordpress,并创建了我的自定义 html 表单。当我提交表单时,它会将我重定向到同一页面 url,但显示该页面不存在。

我的表格:

<form action="" method="post">
                    <div class="form-group">
                        <input type="text" name="name" class="form-control input-text" placeholder="Vaše jméno a příjmení" />
                        <div class="validation"></div>
                    </div>
                    <div class="form-group">
                        <input type="email" class="form-control input-text" name="email" placeholder="Váš e-mail" />
                        <div class="validation"></div>
                    </div>
                    <div class="form-group">
                        <input type="text" class="form-control input-text" name="subject" placeholder="Předmět zprávy" />
                        <div class="validation"></div>
                    </div>
                    <div class="form-group">
                        <textarea class="form-control input-text text-area" name="message" rows="5" placeholder="Vaše zpráva pro nás..."></textarea>
                        <div class="validation"></div>
                    </div>

                    <div class="row">
                        <!-- Google reCAPTCHA widget -->
                        <div class="col-lg-8 col-sm-8">
                            <!-- recaptcha here -->
                        </div>
                        <div class="col-lg-4 col-sm-4" style="padding-right: 0; padding-left: 0;">
                            <div class="text-center" style="margin-right: 7px;"><button name="submit" style="width: 135px; height: 75px; padding:0 !important;" type="submit" class="input-btn">Odeslat</button></div>
                        </div>
                    </div>
                </form>

我试图隐藏我所有的 php 代码,也隐藏 google recaptcha,但没有任何效果,问题出在其他地方。我的action也是空的,只是set方法。

有什么问题,有什么建议吗?

标签: htmlwordpressforms

解决方案


您必须将字段名称更改为其他名称name="name"。有关更多信息,您可以在此处阅读 https://wordpress.stackexchange.com/questions/11749/why-when-i-submit-a-form-in-wordpress-it-loads-a-404-page-though-url -是正确的


推荐阅读