cgi form to email  | |
January 30th, 2006, 12:30 PM
|
#1 (permalink)
| | is 4 f00t secks
Join Date: Aug 2002 Location: Da Burgh
Posts: 4,587
|
I'm looking for a script that will let users fill out a form on a webpage and submit the details via email, but not have it prompt them at all, just return a pretty message that their email was sent. I looked on hotscripts and couldnt find anything free and simple. any tips? |
| |
January 30th, 2006, 06:23 PM
|
#2 (permalink)
| | Member
Join Date: Jan 2006 Location: Europe
Posts: 394
|
If you have a webhost, they usually offer such scripts, usually in the control panel (such as cpanel or vdeck for example). |
| |
January 30th, 2006, 06:25 PM
|
#3 (permalink)
| | dword to your moms
Join Date: Oct 2001 Location: ~/
Posts: 3,195
|
This is a fairly simple script. What language are you looking to do it in? |
| |
January 31st, 2006, 05:31 AM
|
#4 (permalink)
| | is 4 f00t secks
Join Date: Aug 2002 Location: Da Burgh
Posts: 4,587
|
I was thinking it should be easy. I thought i used to have a cgi script that did a good job, but anything but asp should be alright. |
| |
January 31st, 2006, 05:37 AM
|
#5 (permalink)
| | Newbie
Join Date: May 2004 Location: Philippines
Posts: 3,894
| Quote:
<?php
$MailToAddress = "email@email.com"; // your email address
$redirectURL = "thankspage.html"; // the URL of the thank you page.
$MailSubject = "Information Request Form"; // the subject of the message you will receive
$MailToCC = "carbon@carbon.com"; // CC (carbon copy) also send the email to this address (leave empty if you don't use it)
$Message = "";
if (!is_array($HTTP_POST_VARS))
return;
reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$Message .= "<b>$key:</b> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$Message .= "$vala, ";
}
$Message .= "<br>";
}
else {
$val = stripslashes($val);
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $Message .= "$key: - <br>"; }
else { $Message .= "<b>$key:</b> $val<br>"; }
}
}
} // end while
$Message = "<font face=verdana size=2>".$Message;
mail( $MailToAddress, $MailSubject, $Message, "Content-Type: text/html; charset=ISO-8859-1\r\nFrom: ".$email."\r\nBCc: ".$MailToCC);
header("Location: ".$redirectURL);
?>
| copy to notepad then save as .php
then on your form action "method="post" action="mailform.php">
__________________
I miss Dimebag Darrell
Last edited by filipino : January 31st, 2006 at 05:40 AM.
|
| |
January 31st, 2006, 05:51 AM
|
#6 (permalink)
| | Ultimate Member
Join Date: Nov 2005 Location: KY, US of A
Posts: 1,181
|
Would he (the account) need to have execute permissions on the sendmail daemon (under linux/unix) or to a SMTP server (under Windows) for the mail function to work?
I'm asking 'cause I don't know.... 
__________________ Bluegrass ROCKS!!! |
| |
January 31st, 2006, 07:13 AM
|
#7 (permalink)
| | is 4 f00t secks
Join Date: Aug 2002 Location: Da Burgh
Posts: 4,587
| |
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |