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: 1030

# Posted: 13 Mar 2009 06:23 · Edited by: Vishal P. Rao
Reply 


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: 2232

# Posted: 13 Mar 2009 09:31
Reply 


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: 1030

# Posted: 13 Mar 2009 22:55
Reply 


Thanks for checking out NS

__________________
sudsind
Member


Joined: 1 Apr 2009
Posts: 1

# Posted: 1 Apr 2009 02:28
Reply 


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: 1030

# Posted: 1 Apr 2009 07:23
Reply 


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
Member


Joined: 4 Apr 2009
Posts: 1

# Posted: 4 Apr 2009 11:25
Reply 


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: 1030

# Posted: 6 Apr 2009 00:16
Reply 


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

__________________
Iwan100
Member


Joined: 8 Apr 2009
Posts: 1

# Posted: 8 Apr 2009 12:36
Reply 


Many thanks for this great contact form. It works!

My wishlist: The subject field should be a dropdown.

Vihsal, is this possible?

rdkelsey
Member


Joined: 8 Apr 2009
Posts: 4

# Posted: 8 Apr 2009 17:32
Reply 


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
Member


Joined: 17 May 2008
Posts: 246

# Posted: 8 Apr 2009 18:37
Reply 


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

__________________
Vishal P. Rao
Administrator


Joined: 23 Jun 2005
Posts: 1030

# Posted: 9 Apr 2009 06:11
Reply 


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
Member


Joined: 10 Apr 2009
Posts: 2

# Posted: 10 Apr 2009 10:13
Reply 


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

gotrank
Member


Joined: 10 Apr 2009
Posts: 2

# Posted: 10 Apr 2009 10:34
Reply 


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: 1030

# Posted: 11 Apr 2009 06:51
Reply 


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

__________________
eagleeye
Member


Joined: 16 Apr 2009
Posts: 2

# Posted: 16 Apr 2009 06:21
Reply 


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: 1030

# Posted: 17 Apr 2009 01:34
Reply 


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
Member


Joined: 16 Apr 2009
Posts: 2

# Posted: 18 Apr 2009 11:01
Reply 


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: 1030

# Posted: 19 Apr 2009 01:01
Reply 


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
Member


Joined: 8 Apr 2009
Posts: 4

# Posted: 20 Apr 2009 02:48
Reply 


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
Member


Joined: 8 Apr 2009
Posts: 4

# Posted: 20 Apr 2009 10:15
Reply 


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

Vishal P. Rao
Administrator


Joined: 23 Jun 2005
Posts: 1030

# Posted: 21 Apr 2009 01:50
Reply 


rdkelsey:
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.

It can be done Robert. I don't remember getting your email. I'll work on the code and let you know. As I'm on a vacation now, it might take a couple of days.

__________________
jpyarger
Member


Joined: 22 Apr 2009
Posts: 2

# Posted: 22 Apr 2009 11:58
Reply 


hi I am getting this error:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/vhosts/angelettimd.com/httpdocs/contact.php:5) in /var/www/vhosts/angelettimd.com/httpdocs/forms/securimage.php on line 422

jpyarger
Member


Joined: 22 Apr 2009
Posts: 2

# Posted: 22 Apr 2009 12:05
Reply 


also how could I add a "telephone number" field?

Vishal P. Rao
Administrator


Joined: 23 Jun 2005
Posts: 1030

# Posted: 23 Apr 2009 01:35
Reply 


jpyarger:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/vhosts/angelettimd.com/httpdocs/contact.php:5) in /var/www/vhosts/angelettimd.com/httpdocs/forms/securimage.php on line 422

Please make sure you have this line in the beginning of contact.php:

<?php session_start(); ?>

jpyarger:
also how could I add a "telephone number" field?

Please send me an email with your requirements.

__________________
rdkelsey
Member


Joined: 8 Apr 2009
Posts: 4

# Posted: 25 Apr 2009 07:31
Reply 


Vishal P. Rao:
It can be done Robert. I don't remember getting your email. I'll work on the code and let you know. As I'm on a vacation now, it might take a couple of days.

Hi Vishal,

Any progress on this?

--Robert

Vishal P. Rao
Administrator


Joined: 23 Jun 2005
Posts: 1030

# Posted: 29 Apr 2009 07:56
Reply 


rdkelsey:
Hi Vishal,

Any progress on this?

--Robert

I had sent you a PM but I haven't got a reply yet.

__________________
vertigo
Member


Joined: 10 May 2009
Posts: 1

# Posted: 10 May 2009 21:17
Reply 


Hi Vishal,


Is it possible for you to post that drop down menu modification that was mentioned here?? I sure can use that as well.

Any plans to add a few check boxes?? Would love to have that.

Excellent form my man

Vishal P. Rao
Administrator


Joined: 23 Jun 2005
Posts: 1030

# Posted: 11 May 2009 00:01
Reply 


vertigo:
Is it possible for you to post that drop down menu modification that was mentioned here?? I sure can use that as well.

Any plans to add a few check boxes?? Would love to have that.

Whatever customizations you need, you can contact me. It's not possible to post customized versions because each individual has different needs.

__________________
chadstur
Member


Joined: 16 May 2009
Posts: 1

# Posted: 16 May 2009 15:17
Reply 


Hi there,

I wish to have a contact form on my website however, it doesn't seem to work as I do not have PHP on my computer. I have attempted to install it several times, but I always just end up downloading some zip file that has nothing in it called install.

Can you please assist on how I can go about getting PHP on my computer (link to website preferred)

Cheers, Chad

__________________
chad_west@live.co.uk
Vishal P. Rao
Administrator


Joined: 23 Jun 2005
Posts: 1030

# Posted: 18 May 2009 00:42
Reply 


PHP needs to be installed on the server where your website is hosted and not on your PC, unless of course you use it as a server for hosting your sites. Most hosting servers have it installed by default.

__________________
Your Reply
Bold Style  Italic Style  Underlined Style  Image Link  URL Link     :) ;) :-( ... Disable smilies

» Username  » Password 
Only registered users can post here. Enter your login/password correctly before posting a message, or register here 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 use BOLD to highlight entire post.
 


Page loading time (secs): 0.056


Custom Search
Writers wanted!

Show your Love

RSS feed (?)
  Add to My Yahoo! Add to Google Add to My MSN  
Subscribe and get your updates by email

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

Sitemap: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

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