View Full Version : Confirmation page for e-mail form?
PotaTo 01-04-2006, 07:04 PM Hi, how could I make a confirmation page for my e-mail form so that after a user clicks "Submit", they will automatically be redirected to a confirmation page confirming that their e-mail was sent successfully? I need to know how to automatically redirect to another page after "Submit" is clicked.
This is the coding I have so far for my e-mail form page. I do not know if it works, I have never used e-mail forms before, so please correect my coding for me if any is wrong.
<html>
<head>
<title>LP Aboveground</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<STYLE type="text/css">
a:active{color:#444444; }
a:hover{color:#626262; }
<!--
BODY {
scrollbar-face-color:#201C18;
scrollbar-highlight-color:#201C18;
scrollbar-3dlight-color:#201C18;
scrollbar-darkshadow-color:#201C18;
scrollbar-shadow-color:#201C18;
scrollbar-arrow-color:#504038;
scrollbar-track-color:#494036;
}
-->
</STYLE>
</head>
<body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="http://www.lpaboveground.kylosa.com/image_22.gif" text="#666666" bgproperties="fixed">
<BODY BGCOLOR=#000000 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 link=#444444 vlink=#444444>
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<A name="top"></A>
<b>[--<u>contact</u>--]</b><br>
<br>
------------------------------------------------------------<br>
<br>
<form method="post" enctype="text/plain" action='mailto:edwardto@lpaboveground.com'>
<input type="hidden" name="To" value="LP Aboveground">
<input type="hidden" name="next" value="http://www.lpaboveground.kylosa.com/confirmation.htm">
<b>Name:</b><br>
<input type="text" name="Name:" size="50" maxlength="100"><br>
<br>
<b>E-mail Address:</b><br>
<input type="text" name="E-mail Address:" size="50" maxlength="100"><br>
<br>
<b>Message:</b><br>
<textarea name="Message:" rows=5 cols=38></textarea><br>
<br>
<input type="submit" value="Submit"><img src="spacer.gif" width=5 height=1 alt="spacer">
<input type="reset" value="Reset"></form>
</font>
</body>
</html>
Thanks a bunch.
I dont know how to do it in HTML, but I do know how to using php, would you like that?
Douglas 01-04-2006, 07:18 PM Kier will help you, but just a side not, HTML can't tell if the email was successfully sent or not, HTML doesn't send the email, the mail client on the computer sends the mail, using a programming language, like kier will probably show you, will actually send the email from the script :)
As I've got to do something I'll post what to do now for you.
Put this where you want your form to be.
<center><form action="sendmail.php" method="post"><p><br /><input type="text" value="Name" name="subject" /> Sender:<br /><input type="text" value="Email" name="sender" /> Message:<br /><textarea cols="25" rows="10" name="message">Your message here.</textarea> <input type="submit" value="Send" /> </p> </form></center>
Then open notepad and save it as sendmail.php
<?php
// sendmail.php file
$subject = $_POST['subject'];
$sender = $_POST['email'];
$message = $_POST['message'];
$message=$message."\nThis message was sent by: ".$sender;
// Send
if (mail("Your Email address here", $subject, $message)) {
?>
You have sent this email message:<br />
<?php
echo $message;
}
else {
?>
Error sending mail.
<?php
}
?>
You will need to change some of the stuff like Email and the message at the end.
If you gave any questions just ask.
PotaTo 01-04-2006, 08:58 PM Could you explain more in-depth please? I am not familiar with PHP at all, although I would really like to learn; I've seen some really awesome scripts which I really want to use. :(
Thanks :)
What you need to do is.
Put this code here you want the form to be.
<center><form action="sendmail.php" method="post"><p><br /><input type="text" value="Name" name="subject" /> Sender:<br /><input type="text" value="Email" name="sender" /> Message:<br /><textarea cols="25" rows="10" name="message">Your message here.</textarea> <input type="submit" value="Send" /> </p> </form></center>
Then open notepad and save this as sendmail.php
<?php
// sendmail.php file
$subject = $_POST['subject'];
$sender = $_POST['email'];
$message = $_POST['message'];
$message=$message."\nThis message was sent by: ".$sender;
// Send
if (mail("Your Email address here", $subject, $message)) {
?>
You have sent this email message:<br />
<?php
echo $message;
}
else {
?>
Error sending mail.
<?php
}
?>
Then just put your email in and change
You have sent this email message:
To what ever you want.
Then upload it and it will work.
Thats really all there is.
PotaTo 01-07-2006, 02:14 AM Ok, I've decided that I don't want to use PHP. Thanks for all the help anyway though Kier.
I just want to use plain HTML, so all I really need to know is how to redirect a user to another URL when he/she clicks "Submit". I will be using the built-in browser e-mail.
Thanks :).
Douglas 01-07-2006, 02:26 AM Use this:
<html>
<head>
<title>LP Aboveground</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<STYLE type="text/css">
a:active{color:#444444; }
a:hover{color:#626262; }
<!--
BODY {
scrollbar-face-color:#201C18;
scrollbar-highlight-color:#201C18;
scrollbar-3dlight-color:#201C18;
scrollbar-darkshadow-color:#201C18;
scrollbar-shadow-color:#201C18;
scrollbar-arrow-color:#504038;
scrollbar-track-color:#494036;
}
-->
</STYLE>
</head>
<script language="JavaScript" type="text/javascript">
<!--;
function go_submit(url) {
document.email.submit();
window.location=url;
}
//-->
</script>
<body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="http://www.lpaboveground.kylosa.com/image_22.gif" text="#666666" bgproperties="fixed">
<BODY BGCOLOR=#000000 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 link=#444444 vlink=#444444>
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<A name="top"></A>
<b>[--<u>contact</u>--]</b><br>
<br>
------------------------------------------------------------<br>
<br>
<form method="post" enctype="text/plain" action='mailto:edwardto@lpaboveground.com' name="email">
<input type="hidden" name="To" value="LP Aboveground">
<input type="hidden" name="next" value="http://www.lpaboveground.kylosa.com/confirmation.htm">
<b>Name:</b><br>
<input type="text" name="Name:" size="50" maxlength="100"><br>
<br>
<b>E-mail Address:</b><br>
<input type="text" name="E-mail Address:" size="50" maxlength="100"><br>
<br>
<b>Message:</b><br>
<textarea name="Message:" rows=5 cols=38></textarea><br>
<br>
<input type="button" onclick="javascript:go_submit('REDIRECT URL');" value="Submit"><img src="spacer.gif" width=5 height=1 alt="spacer">
<input type="reset" value="Reset"></form>
</font>
</body>
</html>
Something like that will work ;)
PotaTo 01-07-2006, 04:33 AM Could you please make it able to transfer into an iFrame please?
Thanks a bunch :).
Edward To 01-07-2006, 10:26 PM Ok, I'm really sorry, but... could you make it actually PHP instead of HTML again? :( Many people cannot send an e-mail when they use their browser's e-mail service either because they do not know how to set POP3, or either because their host does not allowe them to. :(
This is the coding I have for my Contact Form page: <html>
<head>
<title>LP Aboveground</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
input, textarea { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10 px; color: #56524A; text-decoration: none; background-color: #303030; border-color: black black black; border-style: outset; border-top-width: 1 px; border-right-width: 1 px; border-bottom-width: 1 px; border-left-width: 1 px
}
a:active{color:#444444; }
a:hover{color:#626262; }
<STYLE type="text/css">
<!--
BODY {
scrollbar-face-color:#201C18;
scrollbar-highlight-color:#201C18;
scrollbar-3dlight-color:#201C18;
scrollbar-darkshadow-color:#201C18;
scrollbar-shadow-color:#201C18;
scrollbar-arrow-color:#504038;
scrollbar-track-color:#494036;
}
-->
</style>
</head>
<script language="JavaScript" type="text/javascript">
<!--;
function go_submit(url) {
document.email.submit();
window.location=url;
}
//-->
</script>
<body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="http://www.lpaboveground.kylosa.com/image_22.gif" text="#666666" bgproperties="fixed">
<BODY BGCOLOR=#000000 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 link=#444444 vlink=#444444>
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<A name="top"></A>
<b>[--<u>contact</u>--]</b><br>
<br>
------------------------------------------------------------<br>
<br>
<form method="post" enctype="text/plain" action='mailto:edwardto@lpaboveground.com' name="email">
<input type="hidden" name="Subject" value="LP Aboveground">
<b>Name:</b><br>
<input type="text" name="Name" size="50" maxlength="100"><br>
<br>
<b>E-mail Address:</b><br>
<input type="text" name="E-mail Address" size="50" maxlength="100"><br>
<br>
<b>Message:</b><br>
<textarea name="Message" rows=5 cols=50></textarea><br>
<br>
<input type="button" onclick="javascript:go_submit('http://www.lpaboveground.kylosa.com/confirmation.htm');" value="Send"></form>
</font>
</body>
</html>
And this is the coding I have for my Confirmation page <html>
<head>
<title>LP Aboveground</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10 px; color: #56524A; text-decoration: none; background-color: #303030; border-color: black black black; border-style: outset; border-top-width: 1 px; border-right-width: 1 px; border-bottom-width: 1 px; border-left-width: 1 px
}
a:active{color:#444444; }
a:hover{color:#626262; }
<STYLE type="text/css">
<!--
BODY {
scrollbar-face-color:#201C18;
scrollbar-highlight-color:#201C18;
scrollbar-3dlight-color:#201C18;
scrollbar-darkshadow-color:#201C18;
scrollbar-shadow-color:#201C18;
scrollbar-arrow-color:#504038;
scrollbar-track-color:#494036;
}
-->
</style>
</head>
<body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="http://www.lpaboveground.kylosa.com/image_22.gif" text="#666666" bgproperties="fixed">
<BODY BGCOLOR=#000000 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 link=#444444 vlink=#444444>
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<A name="top"></A>
<b>[--<u>contact</u>--]</b><br>
<br>
------------------------------------------------------------<br>
<br>
Thank you, an attempt to send your message has been made. If a response is not issued within 24 hours, then an error has most likely occurred.</font>
</body>
</html>
Please copy and paste those somewhere so you can get a preview of what I want the PHP version to look like. Or you could go to http://www.lpaboveground.com/ and click "contact" in the nav bar. You must use Internet Explorer or else it will look very messed up.
Thank you so much :) :).
Edward To 01-09-2006, 12:10 AM Sorry for bumping, but please help? :(
Edward To 01-09-2006, 11:44 PM Anyone? :(
Edward To 01-11-2006, 02:00 AM Hello...?
Edward To 01-11-2006, 02:01 AM Okay, I'm sorry, I didn't realize that I was using this account... Edward To and PotaTo are both me :(.
I'm sorry for bumping.
onigiri 01-11-2006, 03:04 AM Contact page:
<html>
<head>
<title>LP Aboveground</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
input, textarea { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10 px; color: #56524A; text-decoration: none; background-color: #303030; border-color: black black black; border-style: outset; border-top-width: 1 px; border-right-width: 1 px; border-bottom-width: 1 px; border-left-width: 1 px
}
a:active{color:#444444; }
a:hover{color:#626262; }
<STYLE type="text/css">
<!--
BODY {
scrollbar-face-color:#201C18;
scrollbar-highlight-color:#201C18;
scrollbar-3dlight-color:#201C18;
scrollbar-darkshadow-color:#201C18;
scrollbar-shadow-color:#201C18;
scrollbar-arrow-color:#504038;
scrollbar-track-color:#494036;
}
-->
</style>
</head>
<script language="JavaScript" type="text/javascript">
<!--;
function go_submit(url) {
document.email.submit();
window.location=url;
}
//-->
</script>
<body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="http://www.lpaboveground.kylosa.com/image_22.gif" text="#666666" bgproperties="fixed">
<BODY BGCOLOR=#000000 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 link=#444444 vlink=#444444>
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<A name="top"></A>
<b>[--<u>contact</u>--]</b><br>
<br>
------------------------------------------------------------<br>
<br>
<form method="post" enctype="text/plain" action="confirm.php">
<input type="hidden" name="Subject" value="LP Aboveground">
<b>Name:</b><br>
<input type="text" name="name" size="50" maxlength="100"><br>
<br>
<b>E-mail Address:</b><br>
<input type="text" name="email" size="50" maxlength="100"><br>
<br>
<b>Subject:</b><br>
<input type="text" name="subject" size="50" maxlength="100"><br>
<br>
<b>Message:</b><br>
<textarea name="Message" rows=5 cols=50></textarea><br>
<br>
<input type="button" onclick="javascript:go_submit('http://www.lpaboveground.kylosa.com/confirmation.htm');" value="Send"></form>
</font>
</body>
</html>
Then rename your confirmation page confirm.php. This is what the code should look like:
<html>
<head>
<title>LP Aboveground</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10 px; color: #56524A; text-decoration: none; background-color: #303030; border-color: black black black; border-style: outset; border-top-width: 1 px; border-right-width: 1 px; border-bottom-width: 1 px; border-left-width: 1 px
}
a:active{color:#444444; }
a:hover{color:#626262; }
<STYLE type="text/css">
<!--
BODY {
scrollbar-face-color:#201C18;
scrollbar-highlight-color:#201C18;
scrollbar-3dlight-color:#201C18;
scrollbar-darkshadow-color:#201C18;
scrollbar-shadow-color:#201C18;
scrollbar-arrow-color:#504038;
scrollbar-track-color:#494036;
}
-->
</style>
</head>
<body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="http://www.lpaboveground.kylosa.com/image_22.gif" text="#666666" bgproperties="fixed">
<BODY BGCOLOR=#000000 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 link=#444444 vlink=#444444>
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<A name="top"></A>
<b>[--<u>contact</u>--]</b><br>
<br>
------------------------------------------------------------<br>
<br>
<?php
// sendmail.php file
$to = Your email address;
$subject = $_POST['subject'];
$sender = $_POST['name'];
$message = $_POST['message'];
$message=$message."\nThis message was sent by: ".$sender;
// Send
if (mail($to, $subject, $message)) {
?>
You have sent this email message:<br />
<?php
echo $message;
}
else {
?>
Error sending mail.
<?php
}
?>
</font>
</body>
</html>
Edward To 01-13-2006, 01:21 PM It doesn't work :(.
stone 01-13-2006, 02:08 PM I tried to hook up Kier's code also...here (http://www.stonethegardener.com/mailform.html) When I test, the form claims to have sent, but I don't recieve it.
I don't need any information on inserting the form into my page...I just want a working send mail form....
Any suggestions?
stone 01-13-2006, 02:19 PM Antibaseball, I can't figure out where to insert my email address into your form.
stone 01-23-2006, 12:02 AM Kier's code works now.
There was a problem with my host- that's since been resolved.
|