开发者

how to include a css-hidden input field in forms

开发者 https://www.devze.com 2022-12-15 01:51 出处:网络
I want to include a css-hidden input field in forms and check if the hidden f开发者_开发知识库ield has it’s value filled out then reject the submissionBrief tutorial: Fighting Spam with CSS

I want to include a css-hidden input field in forms and check if the hidden f开发者_开发知识库ield has it’s value filled out then reject the submission


Brief tutorial: Fighting Spam with CSS

A more comprehensive article on the subject: Stopping spambots with hashes and honeypots


You may try something like this:

if (isset($_POST['submit']) && strlen($_POST['hidden_field']))
{
  // proceed with submission
}
else
{
  // reject because hidden field does not contain any value.
}
0

精彩评论

暂无评论...
验证码 换一张
取 消