Go Back  HTML Forums - Free Webmaster Forums and Help Forums > TOOLS OF THE TRADE > Website Scripts & Content Management Systems
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 04-19-2009, 11:10 AM
  #1
Xeon
Lord (Level 16)
 
Xeon's Avatar
 
Join Date: Feb 2003
Posts: 544
iTrader: (0)
Xeon is on a distinguished road
Forms?

Hi all,

I'm trying to find a good form script which I can host on my own servers.
I've seen this FormMail script by Matt Wright but it's in Perl and my web host doesn't support Perl.

So, I'm looking for PHP ones, preferably those that are easy to install and isn't too overkill. All I need is a simple "Contact us" form, that's all.

I've tried HotScripts.com but a lot of their forms are either too complex and most of them are commercial.

Have also looked at those online hosted ones like Wufoo.com but I don't like their branding on my site, and they limit form submissions to 100 a day for the free package.

Anyone knows?

Thanks!
Xeon
__________________
"Hell is calling for you!" - Rufus, Valkyrie Profile : Silmeria

Last edited by Xeon : 04-19-2009 at 11:15 AM.
Xeon is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 04-19-2009, 12:34 PM
  #2
peter_anderson
Aspirant (Level 2)
 
Join Date: Oct 2008
Posts: 12
iTrader: (0)
peter_anderson is an unknown quantity at this point
Here's a freebie from me. Its a quick one, so apologies if there is an error or whatever.

1. The form page (contact.html or whatever)
Code:
<P><STRONG>Contact us!</STRONG></P>
<P>ALL fields are required.</P>
<form method="POST" action="contact.php">
Name: <input name="name" size="23"><br />
E-mail: <input name="email" size="23"><br />
Subject: <input name="subject" size="23"><br />
Message: 
<textarea cols="70" rows="7" name="message"></textarea><br />
<br>
<img src="captcha_image.php" width="100" height="20"/>:<input name="captcha" size="14"><br>
<input type="submit" value="Submit"></form>

</P></BODY></HTML>
2. contact.php (the form processor)
Code:
<?php

session_start();

if ($_POST["captcha"] != $_SESSION["pass"])
{
die('CAPTCHA Failed, press the Back button on your browser and try again.');
}
$to = "bleh@google.com"; //edit this line to YOUR email
// do not edit below this line!
$from = $_POST["email"];
$subject = $_POST["subject"];
$name = $_POST["name"];
$message = $_POST["message"];
$messagesent = "New contact form submission:
\r\n---\r\n
Name: $name \r\n
Email: $from \r\n
Message: \r\n $message 
\r\n\r\n
Sender's IP: $HTTP_SERVER_VARS[REMOTE_ADDR]";
$headers = "From: $from";
if (!preg_match("/^([a-zA-Z -])+$/",$name))
{
die('Name must consist of letters only.');
}
if (!preg_match("/^([0-9a-zA-Z\.\,\;\?\!\'\ \-])+$/",$subject))
{
die('Subject can only contain letters, numbers, and punctuation.');
}
if (!preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i',$from))
{
die('Invalid e-mail address.');
}
if (!preg_match("/^([0-9a-zA-Z\.\,\;\?\!\'\ \-])+$/",$message))
{
die('Message can only contain letters, numbers, and punctuation.');
}

mail($to,$subject,$messagesent,$headers);

echo "Form has been submitted successfully. Thank you!";
?>
3. captcha_image.php (the captcha)
Code:
<?
//  CAPTCHA image generation
// copyright (c) discussionscript.com

session_start();

// *** Tell the browser what kind of file is come'n at 'em! ***
header("Content-Type: image/jpeg");

// *** Send a generated image to the browser ***
die(create_image());

// *** Function List ***
function create_image()
{
	// *** Generate a passcode using md5
	//	(it will be all lowercase hex letters and numbers ***
	$md5 = md5(rand(0,9999));
	$pass = substr($md5, 10, 5);

	// *** Set the session cookie so we know what the passcode is ***
	$_SESSION["pass"] = $pass;

	// *** Create the image resource ***
	$image = ImageCreatetruecolor(100, 20);

	// *** We are making two colors, white and black ***
	$clr_white = ImageColorAllocate($image, 255, 255, 255);
	$clr_black = ImageColorAllocate($image, 0, 0, 0);

	// *** Make the background black ***
	imagefill($image, 0, 0, $clr_black);

	// *** Set the image height and width ***
	imagefontheight(15);
	imagefontwidth(15);

	// *** Add the passcode in white to the image ***
	imagestring($image, 5, 30, 3, $pass, $clr_white);

	// *** Throw in some lines to trick those cheeky bots! ***
	imageline($image, 5, 1, 50, 20, $clr_white);
	imageline($image, 60, 1, 96, 20, $clr_white);

	// *** Return the newly created image in jpeg format ***
	return imagejpeg($image);

	// *** Just in case... ***
	imagedestroy($image);
}
?>
peter_anderson is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-22-2009, 12:11 AM
  #3
nkjskj
Fighter (Level 4)
 
nkjskj's Avatar
 
Join Date: Apr 2008
Location: india
Posts: 38
iTrader: (0)
nkjskj has disabled reputation
Hey you can use Phpbb, vbulletin, Smf
nkjskj is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 03:47 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.