home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

cgi form to email

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2784
Discussions: 200,966, Posts: 2,379,647, Members: 246,332
Old January 30th, 2006, 12:30 PM   Digg it!   #1 (permalink)
is 4 f00t secks
 
sixf00t4's Avatar
 
Join Date: Aug 2002
Location: Da Burgh
Posts: 4,587
Blog Entries: 3
cgi form to email

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?
__________________
Music (4/15/08) - Video (4/15/08) - blog - Legend of Six RPG
sixf00t4 is offline   Reply With Quote
Old January 30th, 2006, 06:23 PM     #2 (permalink)
Amr
Member
 
Amr's Avatar
 
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).
Amr is offline   Reply With Quote
Old January 30th, 2006, 06:25 PM     #3 (permalink)
dword to your moms
 
krohnjw's Avatar
 
Join Date: Oct 2001
Location: ~/
Posts: 3,195
Send a message via AIM to krohnjw
This is a fairly simple script. What language are you looking to do it in?
krohnjw is offline   Reply With Quote
Old January 31st, 2006, 05:31 AM     #4 (permalink)
is 4 f00t secks
 
sixf00t4's Avatar
 
Join Date: Aug 2002
Location: Da Burgh
Posts: 4,587
Blog Entries: 3
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.
sixf00t4 is offline   Reply With Quote
Old January 31st, 2006, 05:37 AM     #5 (permalink)
Newbie
 
filipino's Avatar
 
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.
filipino is offline   Reply With Quote
Old January 31st, 2006, 05:51 AM     #6 (permalink)
Ultimate Member
 
YottaHertz's Avatar
 
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!!!
YottaHertz is offline   Reply With Quote
Old January 31st, 2006, 07:13 AM     #7 (permalink)
is 4 f00t secks
 
sixf00t4's Avatar
 
Join Date: Aug 2002
Location: Da Burgh
Posts: 4,587
Blog Entries: 3
thanks filipino! found this page too:
http://www.tele-pro.co.uk/scripts/contact_form/
sixf00t4 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl/CGI help Siliconjunkie Webmastering and Programming 4 January 2nd, 2004 12:22 PM
Sending the entire COMPLETED form via cgi SaTaNcLaUz Webmastering and Programming 1 October 28th, 2003 11:32 AM
Does anyone know CGI? ClubMed Webmastering and Programming 5 October 2nd, 2003 04:57 PM
Email submit form? PyroSama Webmastering and Programming 17 April 21st, 2003 06:22 PM
creating an SMTP email messsage via a web form DVNT1 Webmastering and Programming 6 March 6th, 2002 12:57 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (3014)
Forty-six years ago today (9)
The disrespect of Obama by Russian .. (46)
Laptop with wireless problem. (12)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
Regular Build (11)
Internet Lost (5)
windows 7 problem (7)
windows vista security holes (15)
Point and Shoot Camera Suggestions. (6)
Is the PSU I received dead? (13)
radeon x850xt platinum & shader.. (6)
HIS HD5770 graphic card question (15)
Recent Discussions
Open With ..... Win7 (3)
windows vista security holes (15)
Help getting around port 80 for camer.. (4)
Laptop with wireless problem. (12)
Internet Lost (5)
Skillsoft Network+ Study Software Que.. (9)
virus blocking exe. files (1)
Point and Shoot Camera Suggestions. (6)
CPU fan stops spinning randomly (11)
Nvidia GTX 260 problem (1)
Modern Warfare 2: Who Bought It? (65)
Is the PSU I received dead? (13)
Print spooler problem (16)
Kingston Bluetooth Dongle Driver (1)
Multiple Restarts Required at Boot (3)
webcam (0)
upgrade for hp a6101 (0)
tv not turn on-makes clicking sound (2)
EVGA 9800 gtx help with finding a goo.. (11)
Regular Build (11)
Help with onclick and buttons (0)
Virus advise (8)
My monitor won't turn on after instal.. (1)
Dept. of HS: NSA 'Helped' Develop Vis.. (16)
Ideal cheap graph card for PC-Gaming? (18)


All times are GMT -4. The time now is 03:21 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28