07-06-2008, 12:53 AM
|
#1 (permalink)
|
|
Super ModTastic
Join Date: Apr 2005
Location: Apple Valley, MN
Posts: 89
Thanks: 1
|
Problem with mail [SOLVED]
Hello All,
Can someone explain to me what i'm doing wrong here:
PHP Code:
<?php if(isset($_POST['submit'])) {
$to = "contact@michaelfroseth.com"; $subject = "Feedback Results"; $name_field = $_POST['name']; $email_field = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; $numPeople = $_POST['numPeople']; $numMen = $_POST['men'];
foreach($_POST['select'] as $selected) {
$select_msg .= "Date: $selected\n";
} foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value\n";
} $body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message\n $check_msg\n Number of People:$numPeople\n Number of Men: $numMen\n $select_msg\n Phone: $phone"; echo "Data has been submitted to $to!"; mail($to, $subject, $body);
} else {
echo "blarg!";
} ?>
The HTML can be viewed here:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<p><img src="http://www.talkphp.com/images/build1.jpg" width="400" height="240" /></p>
<p><img src="http://www.talkphp.com/images/build2.gif" width="500" height="10" /></p>
<form id="form1" name="form1" method="post" action="process.php">
<label><strong>INFORMATION</strong><br />
<br />
Name:
<input type="text" name="name" />
</label>
<p>
<label>Phone:
<input type="text" name="phone" />
</label>
</p>
<p>
<label>Email:
<input type="text" name="email" />
</label>
</p>
<p><strong>PACKAGE OPTIONS</strong></p>
<p>
<label>Number of People:
<input name="numPeople" type="text" size="4" id="numPeople" />
</label>
<label>Start Date:
<select name="select[]">
<option selected="selected">Jan</option>
<option>Feb</option>
<option>Mar</option>
<option>Apr</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>Aug</option>
<option>Sept</option>
<option>Oct</option>
<option>Nov</option>
<option>Dec</option>
</select>
</label>
<label>
<select name="select[]">
<option selected="selected">1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select>
<select name="select[]">
<option>2008</option>
<option>2009</option>
</select>
</label>
</p>
<p>How many of the inputted number of people are men?
<label>
<input name="men" type="text" size="4" id="men" />
</label>
</p>
<p><strong>SERVICES (click all that apply) </strong></p>
<p>
<label>Bachelor Party
<input type="checkbox" name="check[]" value="checkbox" />
</label>
<label> Bachelorette Party
<input type="checkbox" name="check[]" value="checkbox" />
Limo
<input type="checkbox" name="check[]" value="checkbox" />
</label>
<label>Golf Outing
<input type="checkbox" name="check[]" value="checkbox" />
</label>
<label>Ranch Run
<input type="checkbox" name="check[]" value="checkbox" />
</label>
<label>Nightclub Crawl
<input type="checkbox" name="check[]" value="checkbox" />
</label>
<label>VIP Entry
<input type="checkbox" name="check[]" value="checkbox" />
</label>
</p>
<p>
<label>Bottle Service
<input type="checkbox" name="check[]" value="checkbox" />
</label>
<label>Private Vacation
<input type="checkbox" name="check[]" value="checkbox" />
</label>
<label>Show or Event tickets
<input type="checkbox" name="check[]" value="checkbox" />
</label>
<label>Recreation
<input type="checkbox" name="check[]" value="checkbox" />
</label>
<label>Business Service
<input type="checkbox" name="check[]" value="checkbox" />
</label>
<label>Other:
<input type="text" name="textfield6" />
</label>
</p>
<p><strong>OTHER COMMENTS</strong></p>
<p>
<label>
<textarea name="message" cols="44" rows="10"></textarea>
</label>
</p>
<p>
<label>
<input name="Submit" type="submit" onclick="mailto:sales@kevincollignon.com" value="Submit" />
</label>
</p>
<p><strong>If you have any questions or concerns please contact one of our re</strong></p>
<p><strong>presentatives at (702) 575-4557 </strong></p>
<p> </p>
</form>
<p> </p>
</body>
</html>
Last edited by mike.fro : 07-06-2008 at 01:53 AM.
|
|
|