[英]How can I keep a php form process script from being processed alone, without being called from its html page?
I've been ask to troubleshoot a problem on a very, very old html website which I did not build. 我一直被要求对一个我没有建立的非常老的html网站进行故障排除。 There are two html forms which each call their own php scripts to process them.
有两种HTML表单,每个表单都调用自己的php脚本来处理它们。 They have been getting empty form submissions.
他们一直在提交空白表格。 I put code in place to make three of the fields mandatory as well as added a captcha form.
我将代码放置到位,以使三个字段成为必填字段,并添加了一个验证码表单。 When you go through the normal process, these measures work to stop empty form submissions.
当您执行正常过程时,这些措施可以停止提交空白表格。 However, they are still getting empty form submissions.
但是,他们仍在提交空白表单。 I discovered that if you enter the script url directly in a browser, for example form-process.php, it does submit the empty form without the mandatory fields nor the captcha.
我发现,如果您直接在浏览器中输入脚本URL,例如form-process.php,它将提交没有必需字段或验证码的空表单。
Any suggestions on keeping this script from running on it's own? 关于阻止此脚本自己运行的任何建议?
Thank you in advance. 先感谢您。 PS, I am a php novice, so the php for dummies version would be appreciated.
PS,我是一名PHP新手,因此适用于傻瓜版本的PHP将不胜感激。
You can do two things (either or and) 您可以做两件事(或与)
For more detailed help, you need to receiprocate and provide more details :-) 要获得更多详细的帮助,您需要提供回执并提供更多详细信息:-)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.