I am new to php and I am trying to send a form to an email address. I figured out how to send info from a text box but I need to figure out how to make the results from a check box to my email.
Please help
thanks
Sending a html form to an email using php
Moderator: General Moderators
-
Marcus Brady
- Forum Newbie
- Posts: 2
- Joined: Wed Oct 08, 2003 5:19 pm
//set your form action to a page with this code in it//
// just change the vairables and u should be set//
$mailTo=$_POST["email address"]; // to email address
$mailSubject=$_POST["subject"]; // subject of the mail
if($mailSubject=="")
{
$mailSubject="N/A";
}
//body of the email, or the result from the check box //
$mailBody=$_POST["body"];
$mailFrom=$_POST["from"];
$mailCopy=$_POST["copy"];
$mailBcc=$_POST["bcc"];
//no need to change anything below this
$mail_headers='';
if(!empty($mailFrom)) $mail_headers .="From: $mailFrom\n";
if(!empty($mailCopy)) $mail_headers .="Cc:" .str_replace(";",",", $mailCopy) . "\n";
if(!empty($mailBcc)) $mail_headers .="Bcc:" .str_replace(";",",", $mailBcc) . "\n";
if(mail($mailTo, $mailSubject, $mailBody, $mail_headers))
{
echo "<html</head><body><SCRIPT language=\"Javascript\">alert(\"Email from `$mailFrom` to `$mailTo` have been Sent\");</script></body></html>";
}
else
{
echo "failed";
}
// just change the vairables and u should be set//
$mailTo=$_POST["email address"]; // to email address
$mailSubject=$_POST["subject"]; // subject of the mail
if($mailSubject=="")
{
$mailSubject="N/A";
}
//body of the email, or the result from the check box //
$mailBody=$_POST["body"];
$mailFrom=$_POST["from"];
$mailCopy=$_POST["copy"];
$mailBcc=$_POST["bcc"];
//no need to change anything below this
$mail_headers='';
if(!empty($mailFrom)) $mail_headers .="From: $mailFrom\n";
if(!empty($mailCopy)) $mail_headers .="Cc:" .str_replace(";",",", $mailCopy) . "\n";
if(!empty($mailBcc)) $mail_headers .="Bcc:" .str_replace(";",",", $mailBcc) . "\n";
if(mail($mailTo, $mailSubject, $mailBody, $mail_headers))
{
echo "<html</head><body><SCRIPT language=\"Javascript\">alert(\"Email from `$mailFrom` to `$mailTo` have been Sent\");</script></body></html>";
}
else
{
echo "failed";
}
-
Marcus Brady
- Forum Newbie
- Posts: 2
- Joined: Wed Oct 08, 2003 5:19 pm
//I changed the variables but I couldnt get it to work. Here is the form that I need to send
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<center>
<form name="filmdisc_club" method="post" action="club_subscription.php">
<table width="478" height="187" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="112" height="22" align="right">Name:</td>
<td colspan="5" align="left"><input name="Name" type="text"> </td>
</tr>
<tr>
<td align="right" height="22">Company Name:</td>
<td colspan="5"><input name="Company" type="text" size="45"></td>
</tr>
<tr>
<td align="right" height="15">Address:</td>
<td colspan="5"><input name="Address" type="text" size="45"></td>
</tr>
<tr>
<td align="right" height="15">City:</td>
<td width="144"><input type="text" name="City"></td>
<td width="34" align="right">State:</td>
<td width="55"><input name="State" type="text" size="2" maxlength="2"></td>
<td width="23" align="right">Zip:</td>
<td width="110"><input name="Zip" type="text" size="9" maxlength="10"></td>
</tr>
<tr>
<td align="right" height="15">Phone Number:</td>
<td colspan="5"><input name="Phone" type="text" size="12" maxlength="12"></td>
</tr>
<tr>
<td align="right" height="15">Email Address:</td>
<td colspan="5"><input name="Email" type="text" size="45"></td>
</tr>
</table>
<table width="478" height="15" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="107" align="right">Shipping:</td>
<td width="30" align="right"> </td>
<td width="296" align="left"><p>
<label>
<input type="radio" name="shipping" value="radio">
Overnight</label>
<br>
<label>
<input type="radio" name="shipping" value="radio" checked>
Standard</label>
<br>
</p></td>
<td width="9" align="right">:</td>
<td width="36"> </td>
</tr>
</table>
<p> </p><table width="991" height="152" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="247" height="23"><input name="aerials" type="checkbox" id="aerials" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ae_vol1.html" target="_blank">Aerials</a></td>
<td width="191" height="23"><input name="backgrounds" type="checkbox" id="backgrounds" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/an_vol1.html" target="_blank">Backgrounds</a></td>
<td width="247" height="23"><input name="born_to_be_wild" type="checkbox" id="born_to_be_wild" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/bw_vol1.html" target="_blank">Born to be Wild</a></td>
<td height="23" colspan="3"><input name="business_day" type="checkbox" id="business_day" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/bd_vol1.html" target="_blank">Business Day</a></td>
</tr>
<tr>
<td height="23" ><input name="city_movement" type="checkbox" id="city_movement" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/cm_vol1.html" target="_blank">City Movement</a></td>
<td height="23"><input name="city_scape" type="checkbox" id="city_scape" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/cs_vol1.html" target="_blank">City Scape</a></td>
<td height="23"><input name="corporate_espionage" type="checkbox" id="corporate_espionage" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ce_vol1.html" target="_blank">Corporate Espionage</a></td>
<td height="23" colspan="3"><input name="earthly_views" type="checkbox" id="earthly_views" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ev_vol1.html" target="_blank">Earthly Views</a></td>
</tr>
<tr>
<td height="23"><input name="equestrian" type="checkbox" id="equestrian" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/eq_vol1.html" target="_blank">Equuestrian</a> </td>
<td><input name="exercise_&_fitness" type="checkbox" id="exercise_&_fitness" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ef_vol1.html" target="_blank">Exercise & Fitness </a></td>
<td><input name="eyes" type="checkbox" id="eyes" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ey_vol1.html" target="_blank">Eyes </a></td>
<td colspan="3"><input name="faces" type="checkbox" id="faces" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/fs_vol1.html" target="_blank">Faces </a></td>
</tr>
<tr>
<td height="23"><input name="family" type="checkbox" id="family" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/fa_vol1.html" target="_blank">Family</a></td>
<td><input name="feet" type="checkbox" id="feet" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/fe_vol1.html" target="_blank">Feet </a></td>
<td><input name="gardening" type="checkbox" id="gardening" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ga_vol1.html" target="_blank">Gardening </a></td>
<td colspan="3"><input name="home_office" type="checkbox" id="home_office" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ho_vol1.html" target="_blank">Home Office</a> </td>
</tr>
<tr>
<td height="23"><input name="kids_1" type="checkbox" id="kids_1" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/kids_vol1.html" target="_blank">Kids Vol 1 </a></td>
<td><input name="Kids_2" type="checkbox" id="Kids_2" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/kd_vol2.html" target="_blank">Kids Vol 2 </a></td>
<td><input name="kids_3" type="checkbox" id="kids_3" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/kd_vol3.html" target="_blank">Kids Vol 3 </a></td>
<td colspan="3"><input name="kids_4" type="checkbox" id="kids_4" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/kd_vol4.html" target="_blank">Kids Vol 4 </a></td>
</tr>
<tr>
<td height="23"><input name="life_happens" type="checkbox" id="life_happens" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/lh_vol1.html" target="_blank">Life Happens </a></td>
<td><input name="meeting_of_the_minds" type="checkbox" id="meeting_of_the_minds" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/mm_vol1.html" target="_blank">Meeting of the Minds</a> </td>
<td><input name="native_americans" type="checkbox" id="native_americans" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/na_vol1.html" target="_blank">Native Americans</a></td>
<td colspan="3"><input name="new_york_city" type="checkbox" id="new_york_city" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ny_vol1.html" target="_blank">New York City</a> </td>
</tr>
<tr>
<td height="23"><input name="pets" type="checkbox" id="pets" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/pt_vol1.html" target="_blank">Pets </a></td>
<td><input name="romance_1" type="checkbox" id="romance_1" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/rm_vol1.html" target="_blank">Romance Vol 1</a> </td>
<td><input name="romance_2" type="checkbox" id="romance_2" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/rm_vol2.html" target="_blank">Romance Vol 2</a></td>
<td colspan="3"><input name="san_francisco" type="checkbox" id="san_francisco" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sf_vol1.html" target="_blank">San Francisco</a></td>
</tr>
<tr>
<td height="23"><input name="seniors" type="checkbox" id="seniors" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sr_vol1.html" target="_blank">Seniors</a></td>
<td><input name="serenity" type="checkbox" id="serenity" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sy_vol1.html" target="_blank">Serenity</a></td>
<td><input name="shoot_&_aim" type="checkbox" id="shoot_&_aim" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sh_vol1.html" target="_blank">Shoot & Aim</a></td>
<td colspan="3"><input name="shuttle_launch" type="checkbox" id="shuttle_launch" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sl_vol1.html" target="_blank">Shuttle Launch</a></td>
</tr>
<tr>
<td height="23"><input name="sillhouette" type="checkbox" id="sillhouette" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/si_vol1.html" target="_blank">Sillhouette</a></td>
<td><input name="skate_&_snow" type="checkbox" id="skate_&_snow" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ss_vol1.html" target="_blank">Skate & Snow</a></td>
<td><input name="sports" type="checkbox" id="sports" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sp_vol1.html" target="_blank">Sports</a></td>
<td width="250"><input name="spring_cleaning" type="checkbox" id="spring_cleaning" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sc_vol1.html" target="_blank">Spring Cleaning</a></td>
</tr>
<tr>
<td height="23"><input name="stars_&_stripes" type="checkbox" id="stars_&_stripes" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/st_vol1.html" target="_blank">Stars & Stripes</a></td>
<td><input name="sunsets" type="checkbox" id="sunsets" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/su_vol1.html" target="_blank">Sunsets</a></td>
<td><input name="the_love_of_the_game" type="checkbox" id="the_love_of_the_game" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/tl_vol1.html" target="_blank">The Love of the Game</a></td>
<td colspan="2"><input name="transportation" type="checkbox" id="transportation" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/tr_vol1.html" target="_blank">Transportation</a></td>
</tr>
<tr>
<td height="23"><input name="underwater_life" type="checkbox" id="underwater_life" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ul_vol1.html" target="_blank">Underwater Life</a></td>
<td><input name="venice" type="checkbox" id="venice" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ve_vol1.html" target="_blank">Venice</a></td>
<td><input name="venice_waterways" type="checkbox" id="venice_waterways" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/vw_vol1.html" target="_blank">Venice Waterways</a></td>
<td><input name="young_couples_1" type="checkbox" id="young_couples_1" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/yc_vol1.html" target="_blank">Young Couples Vol 1</a></td>
</tr>
<tr>
<td height="23"><input name="young_couples_2" type="checkbox" id="young_couples_2" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/yc_vol2.html" target="_blank">Young Couples Vol 2</a></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="23" align="right"> </td>
<td>
</td>
<td>
</td>
</tr>
</table>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Clear Form">
</form>
</center>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<center>
<form name="filmdisc_club" method="post" action="club_subscription.php">
<table width="478" height="187" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="112" height="22" align="right">Name:</td>
<td colspan="5" align="left"><input name="Name" type="text"> </td>
</tr>
<tr>
<td align="right" height="22">Company Name:</td>
<td colspan="5"><input name="Company" type="text" size="45"></td>
</tr>
<tr>
<td align="right" height="15">Address:</td>
<td colspan="5"><input name="Address" type="text" size="45"></td>
</tr>
<tr>
<td align="right" height="15">City:</td>
<td width="144"><input type="text" name="City"></td>
<td width="34" align="right">State:</td>
<td width="55"><input name="State" type="text" size="2" maxlength="2"></td>
<td width="23" align="right">Zip:</td>
<td width="110"><input name="Zip" type="text" size="9" maxlength="10"></td>
</tr>
<tr>
<td align="right" height="15">Phone Number:</td>
<td colspan="5"><input name="Phone" type="text" size="12" maxlength="12"></td>
</tr>
<tr>
<td align="right" height="15">Email Address:</td>
<td colspan="5"><input name="Email" type="text" size="45"></td>
</tr>
</table>
<table width="478" height="15" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="107" align="right">Shipping:</td>
<td width="30" align="right"> </td>
<td width="296" align="left"><p>
<label>
<input type="radio" name="shipping" value="radio">
Overnight</label>
<br>
<label>
<input type="radio" name="shipping" value="radio" checked>
Standard</label>
<br>
</p></td>
<td width="9" align="right">:</td>
<td width="36"> </td>
</tr>
</table>
<p> </p><table width="991" height="152" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="247" height="23"><input name="aerials" type="checkbox" id="aerials" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ae_vol1.html" target="_blank">Aerials</a></td>
<td width="191" height="23"><input name="backgrounds" type="checkbox" id="backgrounds" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/an_vol1.html" target="_blank">Backgrounds</a></td>
<td width="247" height="23"><input name="born_to_be_wild" type="checkbox" id="born_to_be_wild" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/bw_vol1.html" target="_blank">Born to be Wild</a></td>
<td height="23" colspan="3"><input name="business_day" type="checkbox" id="business_day" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/bd_vol1.html" target="_blank">Business Day</a></td>
</tr>
<tr>
<td height="23" ><input name="city_movement" type="checkbox" id="city_movement" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/cm_vol1.html" target="_blank">City Movement</a></td>
<td height="23"><input name="city_scape" type="checkbox" id="city_scape" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/cs_vol1.html" target="_blank">City Scape</a></td>
<td height="23"><input name="corporate_espionage" type="checkbox" id="corporate_espionage" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ce_vol1.html" target="_blank">Corporate Espionage</a></td>
<td height="23" colspan="3"><input name="earthly_views" type="checkbox" id="earthly_views" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ev_vol1.html" target="_blank">Earthly Views</a></td>
</tr>
<tr>
<td height="23"><input name="equestrian" type="checkbox" id="equestrian" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/eq_vol1.html" target="_blank">Equuestrian</a> </td>
<td><input name="exercise_&_fitness" type="checkbox" id="exercise_&_fitness" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ef_vol1.html" target="_blank">Exercise & Fitness </a></td>
<td><input name="eyes" type="checkbox" id="eyes" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ey_vol1.html" target="_blank">Eyes </a></td>
<td colspan="3"><input name="faces" type="checkbox" id="faces" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/fs_vol1.html" target="_blank">Faces </a></td>
</tr>
<tr>
<td height="23"><input name="family" type="checkbox" id="family" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/fa_vol1.html" target="_blank">Family</a></td>
<td><input name="feet" type="checkbox" id="feet" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/fe_vol1.html" target="_blank">Feet </a></td>
<td><input name="gardening" type="checkbox" id="gardening" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ga_vol1.html" target="_blank">Gardening </a></td>
<td colspan="3"><input name="home_office" type="checkbox" id="home_office" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ho_vol1.html" target="_blank">Home Office</a> </td>
</tr>
<tr>
<td height="23"><input name="kids_1" type="checkbox" id="kids_1" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/kids_vol1.html" target="_blank">Kids Vol 1 </a></td>
<td><input name="Kids_2" type="checkbox" id="Kids_2" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/kd_vol2.html" target="_blank">Kids Vol 2 </a></td>
<td><input name="kids_3" type="checkbox" id="kids_3" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/kd_vol3.html" target="_blank">Kids Vol 3 </a></td>
<td colspan="3"><input name="kids_4" type="checkbox" id="kids_4" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/kd_vol4.html" target="_blank">Kids Vol 4 </a></td>
</tr>
<tr>
<td height="23"><input name="life_happens" type="checkbox" id="life_happens" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/lh_vol1.html" target="_blank">Life Happens </a></td>
<td><input name="meeting_of_the_minds" type="checkbox" id="meeting_of_the_minds" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/mm_vol1.html" target="_blank">Meeting of the Minds</a> </td>
<td><input name="native_americans" type="checkbox" id="native_americans" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/na_vol1.html" target="_blank">Native Americans</a></td>
<td colspan="3"><input name="new_york_city" type="checkbox" id="new_york_city" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ny_vol1.html" target="_blank">New York City</a> </td>
</tr>
<tr>
<td height="23"><input name="pets" type="checkbox" id="pets" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/pt_vol1.html" target="_blank">Pets </a></td>
<td><input name="romance_1" type="checkbox" id="romance_1" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/rm_vol1.html" target="_blank">Romance Vol 1</a> </td>
<td><input name="romance_2" type="checkbox" id="romance_2" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/rm_vol2.html" target="_blank">Romance Vol 2</a></td>
<td colspan="3"><input name="san_francisco" type="checkbox" id="san_francisco" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sf_vol1.html" target="_blank">San Francisco</a></td>
</tr>
<tr>
<td height="23"><input name="seniors" type="checkbox" id="seniors" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sr_vol1.html" target="_blank">Seniors</a></td>
<td><input name="serenity" type="checkbox" id="serenity" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sy_vol1.html" target="_blank">Serenity</a></td>
<td><input name="shoot_&_aim" type="checkbox" id="shoot_&_aim" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sh_vol1.html" target="_blank">Shoot & Aim</a></td>
<td colspan="3"><input name="shuttle_launch" type="checkbox" id="shuttle_launch" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sl_vol1.html" target="_blank">Shuttle Launch</a></td>
</tr>
<tr>
<td height="23"><input name="sillhouette" type="checkbox" id="sillhouette" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/si_vol1.html" target="_blank">Sillhouette</a></td>
<td><input name="skate_&_snow" type="checkbox" id="skate_&_snow" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ss_vol1.html" target="_blank">Skate & Snow</a></td>
<td><input name="sports" type="checkbox" id="sports" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sp_vol1.html" target="_blank">Sports</a></td>
<td width="250"><input name="spring_cleaning" type="checkbox" id="spring_cleaning" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/sc_vol1.html" target="_blank">Spring Cleaning</a></td>
</tr>
<tr>
<td height="23"><input name="stars_&_stripes" type="checkbox" id="stars_&_stripes" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/st_vol1.html" target="_blank">Stars & Stripes</a></td>
<td><input name="sunsets" type="checkbox" id="sunsets" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/su_vol1.html" target="_blank">Sunsets</a></td>
<td><input name="the_love_of_the_game" type="checkbox" id="the_love_of_the_game" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/tl_vol1.html" target="_blank">The Love of the Game</a></td>
<td colspan="2"><input name="transportation" type="checkbox" id="transportation" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/tr_vol1.html" target="_blank">Transportation</a></td>
</tr>
<tr>
<td height="23"><input name="underwater_life" type="checkbox" id="underwater_life" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ul_vol1.html" target="_blank">Underwater Life</a></td>
<td><input name="venice" type="checkbox" id="venice" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/ve_vol1.html" target="_blank">Venice</a></td>
<td><input name="venice_waterways" type="checkbox" id="venice_waterways" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/vw_vol1.html" target="_blank">Venice Waterways</a></td>
<td><input name="young_couples_1" type="checkbox" id="young_couples_1" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/yc_vol1.html" target="_blank">Young Couples Vol 1</a></td>
</tr>
<tr>
<td height="23"><input name="young_couples_2" type="checkbox" id="young_couples_2" value="checkbox">
<a href="http://www.filmdisc.com/sub_index/yc_vol2.html" target="_blank">Young Couples Vol 2</a></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="23" align="right"> </td>
<td>
</td>
<td>
</td>
</tr>
</table>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Clear Form">
</form>
</center>
</body>
</html>
Code: Select all
<?php
foreach($_POST as $key => $value)
{
$message .= "$key: $value/n";
}
mail("you@host.com", "subject", $message, "from:someone@host.com");
?>the above will get all the fields and email them to you
Ok, if I may jump in.
I got that code (modified for my specific purpose) to work in my case. But, I am wondering how I can,
1) imbed HTML into that $message variable, when I tried to do it, the double quotes just screwed everything up.
2) can you somehow just use a preformatted HTML file as the $message?
------------------------------
In case anyone can use it, here is my little contribution to the script. Instead of using POST variables, I just pick up the scraps from the same page that writes the related or same information to the database before the resultset is freed.
------------------------------
Thanks for the tips
----------------------------
SteedVLX
Not much of a contribution actually, but a neat little portable script.
Sorry to be such a newbie. But, the facinating thing (and new to me) is that the IF statement actually seems to cause the mail() function to execute. And, then checks the condition.?. (apparently)
Is there a name for this? Does it work this way for any function()? Talk about a time-saver.
SteedVLX
I got that code (modified for my specific purpose) to work in my case. But, I am wondering how I can,
1) imbed HTML into that $message variable, when I tried to do it, the double quotes just screwed everything up.
2) can you somehow just use a preformatted HTML file as the $message?
------------------------------
In case anyone can use it, here is my little contribution to the script. Instead of using POST variables, I just pick up the scraps from the same page that writes the related or same information to the database before the resultset is freed.
------------------------------
Thanks for the tips
----------------------------
SteedVLX
Code: Select all
<?php
//sends a confirmation email to the member
$mailTo=$row_rs_member['useremail']; // to email address
$mailSubject="KB ORDER CONFIRMATION " . $last_order_number; // subject of the mail
if($mailSubject=="")
{
$mailSubject="From KB Dot Com";
}
//body of the email
$mailBody="Dear " . $row_rs_member['member_first_name'] . " " . $row_rs_member['member_last_name'] . "," . "
This is a confirmation email from KB Dot Com.
Your order number " . $last_order_number . " has been received. You will receive further details in your verification email which will be sent as soon as we have determined international shipping charges for your order.
Please do not reply to this email as the return address is not monitored for replies.
Thank you for your order.
KB Dot Com
Asian Order Desk";
$mailFrom="FROM: KB Dot Com(Do not reply)";
$mailCopy=$_POST["copy"];
$mailBcc=$_POST["bcc"];
//no need to change anything below this
$mail_headers='';
if(!empty($mailFrom)) $mail_headers .="From: $mailFrom\n";
if(!empty($mailCopy)) $mail_headers .="Cc:" .str_replace(";",",", $mailCopy) . "\n";
if(!empty($mailBcc)) $mail_headers .="Bcc:" .str_replace(";",",", $mailBcc) . "\n";
if(mail($mailTo, $mailSubject, $mailBody, $mail_headers))
{
$confirm_success=1;
echo "<html</head><body><SCRIPT language="Javascript">alert("Confirmation Email from `$mailFrom` has been sent to your registered email address, `$mailTo`");</script></body></html>";
}
else
{
$confirm_success=999; //999 in diag means no-joy on the email to client
echo "failed";
}
?>Sorry to be such a newbie. But, the facinating thing (and new to me) is that the IF statement actually seems to cause the mail() function to execute. And, then checks the condition.?. (apparently)
Is there a name for this? Does it work this way for any function()? Talk about a time-saver.
SteedVLX