I'm having a problem with this formmail. I can't figure out how to do the foreach statement correctly. It should send the information from the checkboxes.
php:
and the accompanying html code:
php:
Code:
<?php
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
foreach($_POST['services'] as $value) {
$check_msg .= "Checked: $value\n";
}
mail( "services@captainmeowbot.com", "Quote Request",
$message, "From: $email" );
header( "Location: http://www.captainmeowbot.com/thanks.html" );
?>
Code:
<html>
<head>
<title>select</title>
<style type="text/css">
<!--
A:link {text-decoration: none;}
A:visited {text-decoration: none;}
-->
</style>
</head>
<body>
<body bgcolor="#FFFFFF" >
<img src="quote.jpg" width="800" height="50" alt="" border="0" align="">
<blockquote>
<table>
<form action="formmail.php" method="post" name="simpleform" id="simpleform">
Name: <input name="name" type="text" /><br />
Email: <input name="email" type="text" /><br />
<p>Which services are you interested in?</p>
<input type="checkbox" name="services" value="printing services and graphic design">printing services and graphic design</p>
<p> <input type="checkbox" name="services" value="business cards">business cards
<input type="checkbox" name="services" value="letterhead">letterhead
<input type="checkbox" name="services" value="postcards">postcards</p>
<p>
<input type="checkbox" name="services" value="image, video, and sound preparation">image, video, and sound preparation<br></p>
<p> <input type="checkbox" name="services" value="scanning and image adjustment">scanning and image adjustment
<input type="checkbox" name="services" value="quicktime files and sound editing">quicktime files and sound editing
<input type="checkbox" name="services" value="mp3s and sound editing">mp3s and sound editing</p>
<p>Description:<br />
<textarea name="message" rows="7" cols="60">
</textarea><br /></p><p>
<input type="submit" value="Submit Form" alt="submit form"></p>
</form>
</table>
</body>
</html>