Hello, I am a beginner. I have a contact form in my website. I received a LOT of spam from it. I would like to stop the spam and maybe include a captcha system. Can anybody help me do that? Here below my code: <?php require 'connexion/connexion.php'; // Connexion à la BDD require 'set/php/fonctions.php'; // Fonctions ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"/> <link rel="icon" href="favicon.ico" /> <!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /><![endif]--> <link rel="stylesheet" type="text/css" media="screen" href="set/css/style.css"/> <script type="text/javascript" src="set/js/jquery-2.2.0.min.js"></script> <!--[if lte IE 7]> <link rel="stylesheet" type="text/css" href="set/css/style-ie.css"> <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script> <![endif]--> <!--[if IE]> <meta http-equiv="X-UA-Compatible" content="IE=10"> <![endif]--> <title>Contact - T</title> </head> <body> <div class="content"> <?php include('set/php/header.php');?> <div class="category_header"> <h1>CONTACT</h1> <?php include('set/php/button-header.php');?> </div> <!-- Fin category_header --> <div class="category_nav"> <ul> <li></li> <li></li> </ul> </div> <!-- Fin category_header --> <div class="contact_bloc" id="contact_info"> <div class="contact_in"> <h2 p style="font-weight:bold;">T</h2><br/> <p>Bergenfield, NJ 07621 USA<br/> Tel : +1-(201)-591-3191<br/> Fax : +1-(509)-695-1417<br/> <a style="text-decoration: none" onMouseOver="this.style.color='#00F'" onMouseOut="this.style.color='black'" href="mailto:contact@t.com">contact@t.com</a> </p> </div> <br/> <br/> <img src="img/contact.jpg" width="280" height="204" alt="T Infos" /> <div class="spacer"></div> </div> <!-- Fin contact_bloc --> <div class="contact_bloc" id="contact_form"> <h2>QUESTIONS OR COMMENTS ?</h2> <br/><br/> <form id="form1" name="form1" method="post" action="contact-envoi.php"> <input name="name" type="text" id="name" placeholder=" * NAME" size="10" /> <input name="company" type="text" id="company" placeholder=" * COMPANY" size="16" /> <br/><br/> <input name="email" type="text" id="email" placeholder=" * EMAIL" size="10" /> <input name="phone" type="text" id="telephone" placeholder=" * TEL" size="16" /> <br/><br/> <select name="type" id="type"> <option value="general-inquiry">GENERAL INQUIRY</option> <option value="product-question">PRODUCT QUESTION</option> </select> <br/><br/> <textarea name="message" placeholder=" * MESSAGE" ></textarea> <br/><br/> <input type="submit" name="send" id="send_form" value=" SEND " /> </form> </div> <!-- Fin contact_form --> <div class="spacer"></div> </div> <!-- Fin content --> </body> </html> <script type="text/javascript"> $(document).ready(function(){ $('img').bind('contextmenu', function(e) { return false; }); }) </script>
Have you considered using Google's Recaptcha instead of building one on your own? They have an option where users don't even have to type letters or select pictures now!
Yes this is exactly what I want to do. I signed up for the service. But I need help inserting their code into my code. Do you think that you can help me?
If you're looking for someone to help you I would look into the marketplace as I'm sure there are many PHP developers. However, take a look at this article https://phppot.com/php/php-contact-form-with-google-recaptcha/, it goes over how to add it into your forms. Hopefully this helps!!