简体   繁体   English

php 联系表格 409 错误

[英]php contact form 409 errors

The website I made for my client is https://pariswashcompany.com/ On this website I get error 409 when the contact form is submitted我为我的客户制作的网站是https://pariswashcompany.com/在这个网站上,当我提交联系表格时,我收到错误 409

I purchased the contact form from bootstrapmade.com Which is a professional company and In their instructions, they say "Fully functional contact form Just change the email to yours in contact.php and it works after that".我从 bootstrapmade.com 购买了联系表格,这是一家专业公司,在他们的说明中,他们说“功能齐全的联系表格只需将 email 更改为您的联系表格即可。ZE1BFD762321E409CEE4AC0B6E8416 之后它就可以工作了”。 When I submit the contact form it throws me error 409 but my hosting company HostGator Cannot seem to solve it, so I was wondering if anyone else had run into this problem.当我提交联系表格时,它会抛出错误 409,但我的托管公司 HostGator 似乎无法解决它,所以我想知道是否有其他人遇到过这个问题。

Solutions I have tried我尝试过的解决方案

1, Hostgator cleared website cache 1、Hostgator清除网站缓存

2, we contacted the creator of the PHP contact form they said error 409 has to do with the hosting company (creator bootstrap made) 2,我们联系了 PHP 联系表的创建者,他们说错误 409 与托管公司有关(创建者引导程序制作)

3, we contacted Hostgator and they told us to set our PHP to 7.4 within our cpanel 3,我们联系了 Hostgator,他们告诉我们在我们的 cpanel 中将我们的 PHP 设置为 7.4

Any help is greatly appreciated at this point thanks.在这一点上非常感谢任何帮助。

There are duplicate ids in the form.表单中有重复的 ID。 email and number have the same id. email编号具有相同的 id。 Ids should be unique. ID 应该是唯一的。

<form action="/forms/contact.php" method="post" role="form" class="php-email-form">
 <div class="row">
 <div class="col-md-4 form-group">
   <input type="text" name="name" class="form-control" id="name" placeholder="Your Name" required>
 </div>
 <div class="col-md-4 form-group mt-3 mt-md-0">
   <input type="email" class="form-control" name="email" id="email" placeholder="Your Email" required>
 </div>
 <div class="col-md-4 form-group mt-3 mt-md-0">
   <input type="number" class="form-control" name="phone" id="email" placeholder="Your number" required>
 </div>
</div>
<div class="form-group mt-3">
  <input type="text" class="form-control" name="subject" id="subject" placeholder="Subject" required>
</div>
<div class="form-group mt-3">
  <textarea class="form-control" name="message" rows="5" placeholder="Message" required></textarea>
</div>
<div class="my-3">
 <div class="loading">Loading</div>
 <div class="error-message"></div>
 <div class="sent-message">Your message has been sent. Thank you!</div>
</div>
<div class="text-center"><button type="submit">Send Message</button></div>
</form>

409 is about consistency/conflict 409 是关于一致性/冲突的

The HTTP 409 Conflict response status code indicates a request conflict with the current state of the target resource. HTTP 409 冲突响应状态码表示请求与目标资源的当前 state 冲突。

Conflicts are most likely to occur in response to a PUT request.响应 PUT 请求时最有可能发生冲突。 For example, you may get a 409 response when uploading a file that is older than the existing one on the server, resulting in a version control conflict.例如,您在上传比服务器上现有文件更旧的文件时可能会收到 409 响应,从而导致版本控制冲突。

Reference: Mozilla: 409 Conflict参考: Mozilla:409 冲突

409 CODE REFERENCES 409 代码参考

Rails HTTP Status Symbol:conflict Rails HTTP 状态符号:冲突

Go HTTP Status Constant http.StatusConflict Go HTTP 状态常数 http.StatusConflict

Symfony HTTP Status Constant Response::HTTP_CONFLICT Symfony HTTP 状态常量 Response::HTTP_CONFLICT

Python2 HTTP Status Constant httplib.CONFLICT Python2 HTTP 状态常量 httplib.CONFLICT

Python3+ HTTP Status Constant http.client.CONFLICT Python3+ HTTP 状态常量 http.client.CONFLICT

Python3.5+ HTTP Status Constant http.HTTPStatus.CONFLICT Python3.5+ HTTP 状态常量 http.HTTPStatus.CONFLICT

Reference: What Is a 409 Status Code?参考: 什么是 409 状态码?

Okay thanks for all your comments i appretiate it hostgator fixed this by white listing my websites code originally the code was black listed by the hosting company好的,感谢您的所有评论

hostgators response Thank you for waiting. hostgators 回复 感谢您的等待。 We successfully whitelist your contact form in a mod sec and it seems fixed it.我们在 mod sec 内成功地将您的联系表单列入白名单,并且似乎已修复。 Can you try again now?你现在可以再试一次吗?

It appears there's a script or code in the contact form that was blocked in mod security.联系表单中似乎有一个脚本或代码在 mod 安全中被阻止。 No worries, it has been whitelisted permanently.不用担心,它已被永久列入白名单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM