PDA

View Full Version : Mailer Expandable?



TheJoshMan
08-03-2008, 10:43 PM
Well, since I must give up hope on my PERL mail script... I suppose I'll give PHP another go. Could someone take a look at this simple mail script and tell me if this is even expandable? I'd like to make the data get sent to more than one recipient, and I'd also like to add more formfields to be sent with the data.

Rather than just Name, email, and message, I'd like to expand it to be a fairly large mail script... I'd also like to add in some "bot stopper/slower downer" stuff... You know, like the "What color is the sky?" "Is fire hot or cold?" that kind of stuff, and maybe a hidden input field that returns an error if it gets filled in.

I'd also like it to redirect to a "verification" page which displays all the input information gathered and requires confirmation before submission, then after submission, redirect to a "thank you page".

The HTML:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Form Tester </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>


<form method="post" action="sendmail.php" id="form">
First Name: <input name="fname" type="text" size="30"/><br /><br />
Last Name: <input name="lname" type="text" size="30"/><br /><br />
Email: &nbsp; &nbsp; &nbsp; &nbsp;<input name="email" type="text" size="30"/><br /><br />
Message:<br />
<textarea name="message" rows="4" cols="33">
</textarea><br /><br />
<span style="float:left;"><input type="reset" value="Oops!" /></span><span style="float:middle;"><input type="submit" value="Send Message" /></span>
</form>


</BODY>
</HTML>



The PHP:


<?php
$fname = $_REQUEST['fname'] ;
$lname = $_REQUEST['lname'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;





mail( "josh_redefined@yahoo.com", "Contact Page Form Submission",
"$fname $lname had this to say: $message", "From: $email" );
header( "Location: http://www.Eight7Teen.com" );
?>




Any ideas?

TheJoshMan
08-04-2008, 07:40 PM
anybody?

thetestingsite
08-04-2008, 07:41 PM
Look at the following sites about the mail headers.

http://us3.php.net/function.mail
http://www.htmlite.com/php029.php

Hope this helps.

TheJoshMan
08-04-2008, 10:23 PM
PERFECT!

Now I just have to figure out how to get he script to gather the data from more input areas (radio buttons, check boxes, select boxes, etc...) so I can have a fully functional contact form.