html - 表单重定向到同一页面,但显示不存在
问题描述
您好,我对 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方法。
有什么问题,有什么建议吗?
解决方案
您必须将字段名称更改为其他名称name="name"
。有关更多信息,您可以在此处阅读
https://wordpress.stackexchange.com/questions/11749/why-when-i-submit-a-form-in-wordpress-it-loads-a-404-page-though-url -是正确的
推荐阅读
- java - Spring Boot JPA:@Modifying @Query 没有效果
- php - PHP array_search通过变量在多维数组中
- mysql - SpringBoot 使用 Hibernate 与 Mysql 集成
- android - Smack 中的聊天标记 (XEP-0333)
- django - Django:如何测试无效的对象创建
- javascript - 检查嵌套括号是否平衡的 JavaScript 正则表达式
- javascript - D3 基于名称而不是索引链接节点
- hibernate - 使用 Java Spring MVC 上传 FOLDER 函数
- html - 在 jinja 框架中存储表单信息
- asp.net - 在.Net中从服务器传输压缩文件