Reputation: 27
I have a form that sends information to a telegram bot, but recently my form is spammed and they send a lot of spam messages.
if (strtoupper($_POST['cp_code']) == strtoupper($_POST['captcha'])){
if (isset($_POST["website"]) && $_POST["website"] == "") {
$username = $_POST['username'];
$password = $_POST['password'];
This is my code. I even use captcha and put a hidden input in the form and check its value in php.
Upvotes: 1
Views: 235
Reputation: 548
It is best to use Google Recaputer to verify if the user is a human. Next you can set a session after making an entry in the input field and refresh the page. Here you could aslong the session is set, hide the contact form or even not echo it on the page via PHP. This is also not a 100% protection because the user can delete the session, but hardly no one want to do this 1000 times in a row. Against a DDoS attack you should set up a plugin on the server, I can recommend "fail2ban".
Upvotes: 1