/    Sign up×
Community /Pin to ProfileBookmark

Information on FORMS for Feedback or Contact Pages – Updated!

Want to save information from a form to a file or email it to yourself? You can’t use HTML for this, you need a server side languages. There are many such languages that you can use, like PHP, ASP, ASP.net, CGI-Perl, JSP, ColdFusion, ect.

First, find out what your host supports and then you can learn the apporpriate language.

If your just starting out I suggest making your post in the CGI-Perl forum.

Thank you,
Compguy Pete

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@96turnerriDec 06.2004 — For any form action you need a server side technology, the most common is a form mailer, this takes the results of a form and mails it to the address specified.

Not all servers/hosting support server side technologys, but there are many free form mailers available on the net for you to use.

I recommend using this script if you server does not support a server side technology (Coded by me)

[URL=http://php.richardturner.com/mailer.php]Original Source[/URL]
[code=php]
//Dont forget to replace the email and thankyou page to your own
<form action="http://php.richardturner.com/mailer.php" method="post">
<p>
<input type="hidden" name="form_email" value="YOUR_EMAIL@DOMAIN" /><br />
<input type="hidden" name="form_thankyou" value="http://www.YOURSITE.com/THANKYOUPAGE.HTML" /><br />
Your Form Here<br />
<input type="submit" value="Submit" />
</p>
</form>
[/code]


or if you server supports PHP (Coded by [URL=http://www.webdeveloper.com/forum/member.php?s=&action=getinfo&userid=728]pyro[/URL] )

[URL=http://www.webdevfaqs.com/php.php#mailer]Original Source[/URL]
[code=php]
<?PHP

#######################################################
# This script is Copyright 2003, Infinity Web Design #
# Distributed by http://www.webdevfaqs.com #
# Written by Ryan Brill #
# All Rights Reserved - Do not remove this notice #
#######################################################

## The lines below need to be edited...

###################### Set up the following variables ######################
#
$to = "[email protected]"; #set address to send form to
$subject = "Results from your Request Info form"; #set the subject line
$headers = "From: Form Mailer"; #set the from address, or any other headers
$forward = 0; # redirect? 1 : yes || 0 : no
$location = "thankyou.htm"; #set page to redirect to, if 1 is above
#
##################### No need to edit below this line ######################

## set up the time ##

$date = date ("l, F jS, Y");
$time = date ("h:i A");

## mail the message ##

$msg = "Below is the result of your feedback form. It was submitted on $date at $time.nn";

if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "n";
}
}

mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you for submitting our form. We will get back to you as soon as possible.";
}

?>
[/code]


or if you server supports ASP

//Coming Soon EDIT: See Below Post By Dave//
Copy linkTweet thisAlerts:
@David_HarrisonDec 06.2004 — Well as Rich said, ASP solution coming soon so here it is. I've made an example form in HTML Strict 4.01 and there's also the script itself in a separate .asp file.

It's pretty simple to use, the form submits to the ASP file which processes the info and then redirects the user to another page. All you have to do is open up the ASP file in notepad and fill in values for 3 variables:SMTPserver = "xxx.xxx.xxx.xxx" ' Specify a valid SMTP mail server.
redir = "http://www.w3.org/" ' Specify a page to redirect the user to once they have submitted the form.
recipient = "[email protected]" ' Specify who to send the email to.


[upl-file uuid=3e939575-66c1-4610-afda-adaff783ceeb size=1kB]mailers.zip[/upl-file]
Copy linkTweet thisAlerts:
@buntineJul 16.2005 — Note, the Persits AspEmail component must be installed and configured on the server for the ASP example to work. AspEmail is available on most modern Windows Servers. See the [url=http://www.persits.com]Persits Web Site[/url] for more information.

Regards.
×

Success!

Help @Compguy_Pete spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...