Work at Home Forum - An online community of those who work from home.
Web Design and Hosting Work at Home Forum / Web Design and Hosting /

Free PHP Contact Form with Spam Protection

Author Message
Vishal P. Rao
Administrator
Joined: 23 Jun 2005
Posts: 1357
#1 · Posted: 13 Mar 2009 06:23 · Edited by: Vishal P. Rao


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

__________________
Newbie Shield
Gold Member
Joined: 22 Sep 2007
Posts: 2226
#2 · Posted: 13 Mar 2009 09:31


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~

Vishal P. Rao
Administrator
Joined: 23 Jun 2005
Posts: 1357
#3 · Posted: 13 Mar 2009 22:55


Thanks for checking out NS

__________________
sudsind
Forums Member
Joined: 1 Apr 2009
Posts: 1
#4 · Posted: 1 Apr 2009 02:28


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

__________________
Sudhanshu
Vishal P. Rao
Administrator
Joined: 23 Jun 2005
Posts: 1357
#5 · Posted: 1 Apr 2009 07:23


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.

__________________
barbon
Forums Member
Joined: 4 Apr 2009
Posts: 1
#6 · Posted: 4 Apr 2009 11:25


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

Vishal P. Rao
Administrator
Joined: 23 Jun 2005
Posts: 1357
#7 · Posted: 6 Apr 2009 00:16


Thank you so much for your comments Anne-Marie It's my pleasure.

__________________
Iwan100
Forums Member
Joined: 8 Apr 2009
Posts: 1
#8 · Posted: 8 Apr 2009 12:36


Many thanks for this great contact form. It works!

My wishlist: The subject field should be a dropdown.

Vihsal, is this possible?

rdkelsey
Forums Member
Joined: 8 Apr 2009
Posts: 4
#9 · Posted: 8 Apr 2009 17:32


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:

<input name="id" type="hidden" value ="<?php echo $_GET['id']; ?>

as a hidden field in the form ... the value of "id" was passed through to the email.

This was to identify which pages people were coming from.

I get an error when I place that hidden field into this form.

How can I make this work?

--Robert

Seth
Forums Member
Joined: 17 May 2008
Posts: 266
#10 · Posted: 8 Apr 2009 18:37


is it possible to add a REDIRECT url after submitting the info ?

__________________
Vishal P. Rao
Administrator
Joined: 23 Jun 2005
Posts: 1357
#11 · Posted: 9 Apr 2009 06:11


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

__________________
gotrank
Forums Member
Joined: 10 Apr 2009
Posts: 2
#12 · Posted: 10 Apr 2009 10:13


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

gotrank
Forums Member
Joined: 10 Apr 2009
Posts: 2
#13 · Posted: 10 Apr 2009 10:34


here is what my contact.php looks like:

<?php session_start(); ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
include 'top.php';
?>

<center><?php include("forms/contact-form.php"); ?></center>

<?PHP include ("bottom.php"); ?>

Vishal P. Rao
Administrator
Joined: 23 Jun 2005
Posts: 1357
#14 · Posted: 11 Apr 2009 06:51


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

__________________
eagleeye
Forums Member
Joined: 16 Apr 2009
Posts: 2
#15 · Posted: 16 Apr 2009 06:21


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

Vishal P. Rao
Administrator
Joined: 23 Jun 2005
Posts: 1357
#16 · Posted: 17 Apr 2009 01:34


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.

__________________
eagleeye
Forums Member
Joined: 16 Apr 2009
Posts: 2
#17 · Posted: 18 Apr 2009 11:01


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

Vishal P. Rao
Administrator
Joined: 23 Jun 2005
Posts: 1357
#18 · Posted: 19 Apr 2009 01:01


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.

__________________
rdkelsey
Forums Member
Joined: 8 Apr 2009
Posts: 4
#19 · Posted: 20 Apr 2009 02:48


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

rdkelsey
Forums Member
Joined: 8 Apr 2009
Posts: 4
#20 · Posted: 20 Apr 2009 10:15


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

Your Reply
   :) ;) :-( ... Disable smilies

» Username  » Password 
Only registered users are allowed to post here. Please enter your login/password details upon posting a message, or sign up first.
Messages not conforming to the forum rules will not be approved or, deleted without any explanation.
Please do not post email addresses. If essential, obfuscate them (user [at] domain.com or something like that).
Please do not apply BOLD to entire post.
Please do not post Titles in all CAPS.
 


Page loading time (secs): 0.053

Custom Search
Member Ranking · Terms of Use · Privacy Policy · About Us · Contact Us · Support Us · Friends

© 2004-2011 Work at Home Forum. All rights reserved.