📜 ⬆️ ⬇️

Fighting spam with css

The point is to make an additional field in the form and hide it with styles from the user. The user does not see the field and does not fill it, but the bot will fill it. On the server side, check whether the field is filled or not.

html:
<form method="post" action="process.php"> <br>
<fieldset><br>
<label>Name: </label><input name="name" type="text" /><br /><br>
<label>Email: </label><input name="email" type="text" /><br /><br>

<label>Comment: </label><input name="comments" type="text" /> <input name="info" class="special" type="text" /> <br>
<input value="Send" type="submit" /> <br>
</fieldset><br>
</form>



css:
body {<br>
line-height:35px;<br>
font-family:Arial, Helvetica, sans-serif;<br>
color:#333;<br>
font-size:14px;<br>
}<br>
.special {<br>
width:5px;<br>
visibility:hidden;<br>

}<br>



According to the author, the amount of spam he fell to 0.
source of
')

Source: https://habr.com/ru/post/12970/


All Articles