Free PHP Contact Form with Spam Protection

Discussion in 'Web Design and Hosting' started by Vishal P. Rao, Mar 13, 2009.

  1. Vishal P. Rao

    Vishal P. Rao Administrator Staff Member

    A simple but secure PHP contact form with image validation (Captcha) for spam protection.

    A contact form is one of the basic requirements of a website. However, most free contact form scripts available are not secure and are prone to hijack (one can use your form to spam people) and automated submissions (contact form spam using bots or software). Scary isn't it? It definitely is.

    Using image validation (Captcha) eliminates (upto 99%) automated form submissions and form hijacking.

    Due to overwhelming response, I have created a new dedicated site for the form! Please download the script from that site:

    Easy PHP Contact Form
     
  2. Newbie Shield

    Newbie Shield Gold Member

    Hi Vishal,

    Captcha does help in minimizing spam.

    I tested your form. I entered everything and hit the code reset to see if it would provide a new captcha code. It did. Code is easy to read. Form is user friendly.

    Submission went well.

    I got the "Contact Form

    We have received your message. If required, we'll get back to you as soon as possible."

    at the end. Seems to work smoothly.

    Very nice.

    ~Newbie Shield~
     
  3. Vishal P. Rao

    Vishal P. Rao Administrator Staff Member

    Thanks for checking out NS [​IMG]
     
  4. sudsind

    sudsind New Member

    Hi, Vishal i want to know how an administrator or website owner recieves the data when somebody submits a form and where the data goes.
    Also please tell me how to insert this php form in our HTML code file.
    Thanks
     
  5. Vishal P. Rao

    Vishal P. Rao Administrator Staff Member

    The data goes to the email address specified in the form. All instructions are provided in the Read Me file. If you still have problems, you can contact me.
     
  6. barbon

    barbon New Member

    Many thanks Vishal for this brilliant contact form... it's exactly what I've been looking for for ages now! Your instructions were very clear which makes all the difference. In my experience, that's where so many others fall down but you really did make them idiot proof!!

    Thanks too for all the help with the changes I wanted to make to it.. you were most helpful and very, very fast!

    Much appreciated.. I'm spreading the word among my web designer friends!!

    Keep up the good work... Anne-Marie
     
  7. Vishal P. Rao

    Vishal P. Rao Administrator Staff Member

    Thank you so much for your comments Anne-Marie [​IMG] It's my pleasure.
     
  8. Iwan100

    Iwan100 New Member

    Many thanks for this great contact form. It works!

    My wishlist: The subject field should be a dropdown.

    Vihsal, is this possible?
     
  9. rdkelsey

    rdkelsey New Member

    Hello,

    I really like this captcha form ... it is working well, but I do have a situation I haven't been able to remedy.

    On the original site we have URLs like:

    domain.com/pagename.php?id=someidentifier

    and in the original form this was used:
     
  10. Seth

    Seth New Member

    is it possible to add a REDIRECT url after submitting the info ?
     
  11. Vishal P. Rao

    Vishal P. Rao Administrator Staff Member

    rdkelsey: How can I make this work?
    Just send me a message and I can send you the modified form.

    Seth: is it possible to add a REDIRECT url after submitting the info ?
    Yes, that's possible!

    Iwan100: My wishlist: The subject field should be a dropdown.

    Vihsal, is this possible?
    Anything is possible [​IMG]
     
  12. gotrank

    gotrank New Member

    I got the form to post, but the captcha doesn't come up. Any thoughts?
     
  13. gotrank

    gotrank New Member

    here is what my contact.php looks like:
     
  14. Vishal P. Rao

    Vishal P. Rao Administrator Staff Member

    gotrank, unless you provide me with your FTP details, it's not possible for me to find why the Captcha is not working.
     
  15. eagleeye

    eagleeye New Member

    buddy when i submit the form, i get these errors

    Warning: main(/securimage.php) [function.main]: failed to open stream: No such file or directory in C:\Inetpub\vhosts\jawadmedia.com\httpdocs\contact-form.php on line 141

    Warning: main() [function.include]: Failed opening '/securimage.php' for inclusion (include_path='.;./includes;./pear') in C:\Inetpub\vhosts\jawadmedia.com\httpdocs\contact-form.php on line 141

    Fatal error: Cannot instantiate non-existent class: securimage in C:\Inetpub\vhosts\jawadmedia.com\httpdocs\contact-form.php on line 142
     
  16. Vishal P. Rao

    Vishal P. Rao Administrator Staff Member

    I believe you are trying to get it work on your local machine. If that's the case then it may not work because path structures on local machines are different from that of web servers.
     
  17. eagleeye

    eagleeye New Member

    no buddy i always work on my webserver i use and test everything on the webhost server.
     
  18. Vishal P. Rao

    Vishal P. Rao Administrator Staff Member

    eagleeye: no buddy i always work on my webserver i use and test everything on the webhost server.
    Can I have your FTP access? Here's how to contact me.
     
  19. rdkelsey

    rdkelsey New Member

    Vishal P. Rao: rdkelsey:
    How can I make this work?

    Just send me a message and I can send you the modified form.

    Hi Vishal,

    I did send you an email back on April 9. This issue is getting more important now.

    What I need to do is have a url like:

    domain.com/somepage.html?id=pagename

    and have the "pagename" as the ID passed through to the email sent by the form.

    How can I make this happen?

    Robert
     
  20. rdkelsey

    rdkelsey New Member

    rdkelsey: What I need to do is have a url like:

    domain.com/somepage.html?id=pagename

    and have the "pagename" as the ID passed through to the email sent by the form.

    Vishal, maybe I make this a bit more clear ...

    There are a lot of links throughout this site that point to the "Contact Form" ... each of the links is a URL like the above, to identify which page the user clicked the "Contact From" link from ... this shows us which pages get the most queries and helps know how people are using the site.

    The link "ID" needs to pass through the contact form and into the email.

    --Robert
     

Share This Page