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
c_nordheim
Forums Member
Joined: 7 Dec 2011
Posts: 4
#181 · Posted: 12 Dec 2011 15:27


Hi Vishal,
Here is some feedback regarding my problem. The SMTP Authentication version also did not work. After a lot of googling it seems the problem is with Godaddy. They do not allow form emails to be sent in that way, but they supply their own form file. So I did the following:

In my Godaddy account settings I entered the email address I want my form to send the messages to. Then Godaddy automatically creates a gdform.php file and places it in my rootdirectory.

I then created contact.html and copy pasted godaddy's demo form:
<form action="/gdform.php" method="post">
<input type="hidden" name="subject" value="Form Submission" />
<input type="hidden" name="redirect" value="thankyou.html" />
<p>First Name:<input type="text" name="FirstName" /></p>
<p>Last Name:<input type="text" name="LastName" /></p>
<p>E-Mail:<input type="text" name="email" /></p>
<p>Comments:<textarea name="comments" cols="40" rows="10">
Type comments here.</textarea></p>
<input type="submit" name="submit" value="submit"/>
</form>

So contact.html sends the information to gdform.php which in turn sends it to my email. This is the only way it get a form to work on godaddy. But unfortunately the form is very simple, no design, no captcha, no validation.

I do not know php, how easy/difficult is it to modify your form to send the message via gdform.php?

FYI, this is the gdform.php code:
<?php
$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET")
{
$query_vars = $_GET;
}
elseif ($request_method == "POST")
{
$query_vars = $_POST;
}

reset($query_vars);
$t = date("U");
$file = $_SERVER['DOCUMENT_ROOT'] . "\ssfm\gdform_" . $t;
$fp = fopen($file,"w");

while (list ($key, $val) = each ($query_vars))
{
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\r\n");
fputs($fp,"$val\r\n");
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\r\n");
if ($key == "redirect")
{
$landing_page = $val;
}
}

fclose($fp);

if ($landing_page != "")
{
header("Location:http://".$_SERVER["HTTP_HOST"]."/$landing_page");
}
else
{
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
}
?>

Vishal P. Rao
Administrator
Joined: 23 Jun 2005
Posts: 1357
#182 · Posted: 13 Dec 2011 05:45


What the above file (gdform.php) does is just create a file with your form contents in a directory "ssfm" in your server root directory. I believe they have cron job running to mail the contents of this file at regular intervals.

With the above setup, I think you'll not receive the contents of the form message immediately. It'll be mailed at regular intervals (5,15 or 30 mins), as specified by GoDaddy.

c_nordheim:
The SMTP Authentication version also did not work.

What was the error you were getting with this?

__________________
spear
Forums Member
Joined: 18 Dec 2011
Posts: 1
#183 · Posted: 18 Dec 2011 16:42


Hi Vishal,

Thank you for your great work!
I don't get any error if I enter whatever symbols I wish for email, name, etc ... The "Email validation function" seems doesn't work. The only is that have no letter then, but the sender wont know this.

kkri78
Forums Member
Joined: 19 Jan 2012
Posts: 1
#184 · Posted: 19 Jan 2012 20:54


Vishal,
The image is not showing in my system?
Do i need to configure something.
I followed the instruction you specified but it doesn't work.

__________________
Kumar
Vishal P. Rao
Administrator
Joined: 23 Jun 2005
Posts: 1357
#185 · Posted: 20 Jan 2012 01:01


Please check if GD libraries are installed on your server. Most likely they are not installed.

__________________
anshu
Forums Member
Joined: 27 Mar 2012
Posts: 1
#186 · Posted: 27 Mar 2012 00:19


Hey!
I tried to run your contact form but it shows this error after i click on the submit button:
Mailer Error: Could not instantiate mail function.

Please tell me what I can do to solve this problem.

Thanx!

Vishal P. Rao
Administrator
Joined: 23 Jun 2005
Posts: 1357
#187 · Posted: 28 Mar 2012 06:51


anshu
Your web host has probable disabled PHP Sendmail function. Talk with them for alternatives. If they allow SMTP authentication, then you can try using that version.

__________________
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.040

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.