pixeltrace Posted January 24, 2007 Share Posted January 24, 2007 guys, ???i really really need your help on this.i have two page form. eform.php and sendmail.phpthe eform is for the form that needs to be filled up and the sendmail is the page that verifies and sends the information from the form via email.below is my code for the eform.php[code]<table width="200" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td><table width="641" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="641"> </td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"><form id="form1" name="form1" method="post" action="sendmail.php"> <table width="617" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="4"> </td> <td width="95" valign="top"><span class="item1">Salutation:</span></td> <td width="10"> </td> <td width="332" valign="top"> <select name="salutation" class="item1f"> <option value="Mr." selected="selected">Mr.</option> <option value="Mr.">Ms.</option> <option value="Mr.">Mrs.</option> </select></td> <td width="182"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td valign="top"><span class="item1">Surname:</span><span class="item2">*</span></td> <td> </td> <td valign="top"> <input name="surname" type="text" class="item1f" /></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td valign="top"><span class="item1">Firstname:<span class="item2">*</span></span></td> <td> </td> <td valign="top"><input name="firstname" type="text" class="item1f" /></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td valign="top"><span class="item1">E-mail: </span><span class="item2">*</span> </td> <td> </td> <td valign="top"><input name="email" type="text" class="item1f" /></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td valign="top"><span class="item1">Telephone: </span><span class="item2">*</span></td> <td> </td> <td valign="top"><input name="phone" type="text" class="item1f" /></td> <td class="item2">* please include country and area code </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td valign="top" class="item1">Fax: </td> <td> </td> <td valign="top"><input name="fax" type="text" class="item1f" /></td> <td class="item2">* please include country and area code</td> </tr> <tr> <td> </td> <td valign="top"> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td valign="top"><span class="item1">Address:<span class="item2">*</span></span></td> <td> </td> <td> <textarea name="address" cols="30" rows="5" class="item1f"></textarea> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td valign="top"><span class="item1">Country:</span></td> <td> </td> <td><SELECT NAME="country" size="1" class="item1f"> <option value="#" selected>Select your Country: </option> <option value="#">- - - - - - - - - - - - - - - - - - - - - - - -</option> <option value="Afghanistan">Afghanistan </option> </SELECT></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td valign="top"><span class="item1">Resortl:</span></td> <td> </td> <td><select name="resort" class="item1f"> <option value="Banyan Tree Bahrain">Banyan Tree Bahrain</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td valign="top"><span class="item1"> Activities:</span></td> <td> </td> <td colspan="2"><table width="513" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="27" rowspan="2" valign="top"><input name="checkbox" type="checkbox" class="item1f" value="item1"></td> <td width="476"><span class="item3">• Night snorkeling on the house reef</span></td> </tr> <tr> <td class="item2"> Price: 5USD </td> </tr> <tr> <td rowspan="2" valign="top"><input name="checkbox" type="checkbox" class="item1f" value="item2"></td> <td><span class="item3">• Dawn snorkeling on the house reef</span> </td> </tr> <tr> <td><span class="item2"> Price: 5USD </span></td> </tr> <tr> <td rowspan="2" valign="top"><input name="checkbox" type="checkbox" class="item1f" value="item3"></td> <td class="item3"> • Coral planting in the lagoon </td> </tr> <tr> <td class="item3"><span class="item2"> Price: 5USD </span></td> </tr> <tr> <td rowspan="2" valign="top"><input name="checkbox" type="checkbox" class="item1f" value="item4"></td> <td class="item3">• Introduction to the biology, ecology and conservation of reef sharks and sea turtles: tour of research </td> </tr> <tr> <td class="item3"><span class="item2"> Price: 5USD </span></td> </tr> <tr> <td rowspan="2" valign="top"><input name="checkbox" type="checkbox" class="item1f" value="item5"></td> <td class="item3">• Reef Survey - using internationally accepted methods and criteria, a comparative survey of the house </td> </tr> <tr> <td class="item3"><span class="item2"> Price: 24USD </span></td> </tr> <tr> <td rowspan="2" valign="top"><input name="checkbox" type="checkbox" class="item1f" value="item6"></td> <td class="item3">• Tree Planting: planting of coconut palms on beach </td> </tr> <tr> <td class="item3"><span class="item2"> Price: 5USD </span></td> </tr> <tr> <td rowspan="2" valign="top"><input name="checkbox" type="checkbox" class="item1f" value="item7"></td> <td class="item3">• Bird nesting box construction </td> </tr> <tr> <td class="item3"><span class="item2"> Price: 5USD </span></td> </tr> <tr> <td rowspan="2" valign="top"><input name="checkbox" type="checkbox" class="item1f" value="item8"></td> <td class="item3">• Dolfin cruise with Marine biology guide </td> </tr> <tr> <td class="item3"><span class="item2"> Price: 80USD </span></td> </tr> </table></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td class="item1">Persons:</td> <td> </td> <td valign="top"><input name="adult" type="text" class="item1f" size="4" maxlength="3" /> <span class="item1">Adult</span> <input name="child" type="text" class="item1f" size="4" maxlength="3" /> <span class="item1">Child</span></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td class="item1">Arrival Date: </td> <td> </td> <td><select name="day" class="item1f"> <option value="01">01</option> </select> <select name="month" class="item1f"> <option value="January 2007">January 2007</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td valign="top" class="item1">Special Request: </td> <td> </td> <td><textarea name="special" cols="30" rows="5" class="item1f"></textarea></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> <input name="Submit" type="submit" class="item1f" value="Submit" /> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table></td> </tr> <tr> <td> </td> </tr></table>[/code]and this is the code for my sendmail.php[code]<?php$salutation = $_POST['salutation'];$surname = $_POST['surname'];$firstname = $_POST['firstname'];$email = $_POST['email'];$phone = $_POST['phone'];$fax = $_POST['fax'];$address = $_POST['address'];$country = $_POST['country'];$resort = $_POST['resort'];$adult = $_POST['adult'];$child = $_POST['child'];$day = $_POST['day'];$month = $_POST['month'];$special = $_POST['special'];if((!$surname) || (!$firstname) || (!$email) || (!$phone) || (!$address)) { echo '<script language=javascript> alert("You did not submit the following required information!");</script>'; if(!$surname){ echo '<script language=javascript> alert("Surname is required");top.location = "eform.php";</script>'; } if(!$firstname){ echo '<script language=javascript> alert("Firstname is required");top.location = "eform.php";</script>'; } if(!email_is_valid($email)) { echo '<script language=javascript> alert("Please use a valid Email Address");top.location = "eform.php";</script>'; } if(!$phone){ echo '<script language=javascript> alert("Phone is required");top.location = "eform.php";</script>'; } if(!$address){ echo '<script language=javascript> alert("Address is required");top.location = "eform.php";</script>'; } exit();//this will put your options in a list...so if 2, 4, and 5 are selected it will print "2, 4, 5"$checkbox = implode(",""<br>", $_POST['checkbox']);$Message = "";$Message .= "An Earth Day Participate email from: $salutation $firstname $surname\n";$Message .= "Telephone Number: $phone\n";$Message .= "Fax Number: $fax\n";$Message .= "Email Address: $email\n";$ip = getenv("REMOTE_ADDR");$Message .="IP address:".$ip."\n";$Message .= "Address: $address , $country \n";$Message .= "Resort Location: $resort\n";$Message .= "Activity Selected: $checkbox\n";$Message .= "Number of Adults: $adult\n";$Message .= "Number of Kids: $child\n";$Message .= "Arrival Date: $day $month\n";$Message .= "\n\n";$Message .= "Special Request: $special\n";$Header = $email;$To = "reservation@banyantree.com";$Subject = "Earth Day Participation"; // mail($To,$Subject,$Message,"From: $Header","-f $EmailAdd"); last parameter might not be supportedmail($To,$Subject,$Message,"From: $Header");echo '<script language=javascript> alert("Your Participation Request has been submitter. Thank you!");top.location = "eform.php";</script>';function email_is_valid ($email) { if(eregi("^[0-9a-z_]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $email, $check)){ if ( getmxrr(substr(strstr($check[0], '@'), 1), $validate_email_temp) ) { return TRUE; } // THIS WILL CATCH DNSs THAT ARE NOT MX. if(checkdnsrr(substr(strstr($check[0], '@'), 1),"ANY")){ return TRUE; } } return FALSE; }?>[/code]hoping for your help on this. thanks a lot!!! Quote Link to comment https://forums.phpfreaks.com/topic/35455-need-help-on-my-form-with-check-boxes/ Share on other sites More sharing options...
pixeltrace Posted January 24, 2007 Author Share Posted January 24, 2007 by the way, my problem here is when i am about to send the formit just goes to the sendmail.phpnothing esle is happening.the pop up that should appear telling that the message has been sentis not appearingi dont get any emails too.need help please. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/35455-need-help-on-my-form-with-check-boxes/#findComment-167771 Share on other sites More sharing options...
pixeltrace Posted January 25, 2007 Author Share Posted January 25, 2007 need help please!!!! Quote Link to comment https://forums.phpfreaks.com/topic/35455-need-help-on-my-form-with-check-boxes/#findComment-168631 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.