douduo2407 2016-07-07 09:35
浏览 67

防止! 表单连续提交,仅限PHP

I just want a code that can stops a user from submitting a form continuously

example if the user is a kind of an attacker . and I read that it can cause a DDOS attack too. (Correct me if I am wrong.)

Thanks it will really help me. If you give me some suggestions and advices.Thank you.

  • 写回答

1条回答 默认 最新

  • dspows0637 2016-07-07 10:01
    关注

    You can use a captcha or a randomly-generated hidden token in order to enforce the expected flow chain, i.e. avoid direct form submissions using curl or any HTTP request forgery tool. This will also help you get protected against the CSRF exploit.

    You will check the consistency of the token before executing the [supposedly heavy] logic of processing the actual form (database accesses, e-mail notifications, etc.).

    However, as other users pointed out, this will NOT prevent the HTTP server from receiving and dispatching the malicious requests, and spawning a PHP process. Better than nothing though.

    评论

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler