lacluna
May 2nd, 2005, 04:46 PM
Hi. I'm trying to build up my page and I'd want to put an option where my visitors can give me their e-mail. Just a little blank box with the button "submit" next to it. How can I do it in dreamweaver?... and also, what program would you recommend for managing mailing lists?
thanks!
LAC
Enigmatic
May 3rd, 2005, 04:03 AM
<?php
if(isset($_POST['contact']))
{
$email = strip_tags($_POST['email'], '');
// You, the recepient
$to = "Webmaster <bilbo_baggins.com>"; //yourname and email address
// Addtional headers
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $name <$email>\r\n";
mail($to, $headers);
echo "";//if the client browser does not ,give your thanks message here
header("Refresh:5; URL = http://www.your_domain.com/thankyou.php"); //"your thankyou url
exit;
}
?>
<HTML>
<HEAD>
<TITLE>Email Submission</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<style type="text/css">
.button
{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10;
color:#000000;
height:18px;
width:50px;
border-color:#666666;
border-width:1px;
background-color:#CCCCCC;
}
.input_box
{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10;
color:#000099;
height:18px;
width:200px;
border-color:#666666;
border-width:1px;
background-color:#FFFFFF;
}
.text
{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10;
color:#000000;
}
</style>
<script language="JavaScript" type="text/JavaScript">
function checkForm()
{
var gemail;
with(window.document.contactform)
{
gemail = email;
}
if(gemail.value == '')
{
alert('Please enter your email!');
gemail.focus;
return false;
}
else
{
return true;
}
}
</script>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<DIV ALIGN=CENTER>
<table align="center" border="0" cellpadding="5" cellspacing="0">
<tr>
<td>
<form name="contactform" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" onSubmit="return checkForm();">
<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<td align="right" valign="middle" class="text">Your Email:</td>
<td><input name="email" type="text" class="input_box" size="30"></td>
<td><input name="contact" type="submit" class="button" value="Submit"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</DIV>
</BODY>
</HTML>
Theres a bit of code for you to look over.
In Dreamweaver, you need to open the "Forms" menu. From this menu you can select objects such as buttons, text boxes, form tags and other form objects.
As for the mailing list ...
http://www.hotscripts.com/PHP/Scripts_and_Programs/Mailing_List_Managers/
Take a look at a few of those.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.