cmbcorp
Members-
Posts
35 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
cmbcorp's Achievements
Newbie (1/5)
0
Reputation
-
CHECK BOXES IN PHP CONTACT FORM NOT BEING EMAILED / DISPLAYED
cmbcorp replied to cmbcorp's topic in PHP Coding Help
sorry here is the latest code with your suggestions: <?php $to = $_REQUEST['sendto']; $from = $_REQUEST['Email']; $name = $_REQUEST['Name']; $company = $_REQUEST['Company']; $phone = $_REQUEST['Phone']; $check = $_REQUEST['check']; $Reporting = $_REQUEST['check'][0]; $Stock = $_REQUEST['check'][1]; $POS = $_REQUEST['check'][2]; $Customer = $_REQUEST['check'][3]; $headers = "From: $from"; $subject = "RetailCare.com.au - Free Consulting Session - Conctact Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"Message"} = "Message"; $check_msg .= "Checked: $value\n"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b) { $body.=sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: noreply@retailcare.com.au"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for for your query. A Sales representitive will be in contact with you shortly!."; if($from=='') {print "You have not entered an email, please go back and try again";} if($name=='') {print "You have not entered a name, please go back and try again";} if($phone=='') {print "You have not entered a phone number, please go back and try again";} if($company=='') {print "You have not entered a company name, please go back and try again";} else { $send = mail($to, $subject, $body, $check_msg, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { header("Location: http://www.retailcare.com.au/thankyou.html"); } else { echo "We encountered an error sending your mail, please notify sales@retailcare.com.au"; } } ?> [\code] -
CHECK BOXES IN PHP CONTACT FORM NOT BEING EMAILED / DISPLAYED
cmbcorp replied to cmbcorp's topic in PHP Coding Help
Thanks for your help ialsoagree. I will play around with your suggestions. Thanks for your help to Mchl. To Mchl: Here is the latest code as you requested: <?php $to = $_REQUEST['sendto']; $from = $_REQUEST['Email']; $name = $_REQUEST['Name']; $company = $_REQUEST['Company']; $phone = $_REQUEST['Phone']; $check = $_REQUEST['check']; $check = implode(', ', $_REQUEST['check']); $headers = "From: $from"; $subject = "RetailCare.com.au - Free Consulting Session - Conctact Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"Message"} = "Message"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b) { $body.=sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: noreply@retailcare.com.au"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for for your query. A Sales representitive will be in contact with you shortly!."; if($from=='') {print "You have not entered an email, please go back and try again";} if($name=='') {print "You have not entered a name, please go back and try again";} if($phone=='') {print "You have not entered a phone number, please go back and try again";} if($company=='') {print "You have not entered a company name, please go back and try again";} else { $send = mail($to, $subject, $body, $check_msg, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { header("Location: http://www.retailcare.com.au/thankyou.html"); } else { echo "We encountered an error sending your mail, please notify sales@retailcare.com.au"; } } ?> -
CHECK BOXES IN PHP CONTACT FORM NOT BEING EMAILED / DISPLAYED
cmbcorp replied to cmbcorp's topic in PHP Coding Help
ok understand. slightly. i renamed the values to have their own. and i agree about the check boxes. is there any help you could give me and see where i have gone wrong? Would really appriciate your help. Thanks. -
CHECK BOXES IN PHP CONTACT FORM NOT BEING EMAILED / DISPLAYED
cmbcorp replied to cmbcorp's topic in PHP Coding Help
thanks once again for your help. i have edited the code for my php script: <?php $to = $_REQUEST['sendto']; $from = $_REQUEST['Email']; $name = $_REQUEST['Name']; $company = $_REQUEST['Company']; $phone = $_REQUEST['Phone']; $Reporting = $_REQUEST['Reporting']; $Stock = $_REQUEST['Stock']; $POS = $_REQUEST['POS']; $Customer = $_REQUEST['Customer']; $headers = "From: $from"; $subject = "RetailCare.com.au - Free Consulting Session - Conctact Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"Message"} = "Message"; $check_msg .= "Checked: $value\n"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b) { $body.=sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: noreply@retailcare.com.au"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for for your query. A Sales representitive will be in contact with you shortly!."; if($from=='') {print "You have not entered an email, please go back and try again";} if($name=='') {print "You have not entered a name, please go back and try again";} if($phone=='') {print "You have not entered a phone number, please go back and try again";} if($company=='') {print "You have not entered a company name, please go back and try again";} else { $send = mail($to, $subject, $body, $check_msg, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { header("Location: http://www.retailcare.com.au/thankyou.html"); } else { echo "We encountered an error sending your mail, please notify sales@retailcare.com.au"; } } ?> Still not bringing the check box values across. sorry to be a no brainer, any other suggestions? cheers, -
CHECK BOXES IN PHP CONTACT FORM NOT BEING EMAILED / DISPLAYED
cmbcorp replied to cmbcorp's topic in PHP Coding Help
thanks, ok so i made each value different for each check box. <form method="post" action="sendtraining.php"> <p> <label>Department:</label> <select name="sendto"> <option value="jasonshico@live.com.au" selected="selected">Training Department</option> </select></label> <br /> <label><span class="style1">*</span> Name</label> <input name="Name" value="Your Name" type="text" size="30" /> <label><span class="style1">*</span> Company Name</label> <input name="Company" value="Company Name" type="text" size="30" /> <label><span class="style1">*</span> Email</label> <input name="Email" value="Your Email" type="text" size="30" /> <label><span class="style1">*</span> Phone Number</label> <input name="Phone" value="Your Phone Number" type="text" size="30" /> <label>Additional Training Modules </label> <input type="checkbox" name="check[]" value="Reporting" /> Reporting<br /> <input type="checkbox" name="check[]" value="Stock" /> Advanced Stock Management (Promotions, Audit trails, Deletions, Transfers etc.)<br /> <input type="checkbox" name="check[]" value="POS" /> POS Training overview<br /> <input type="checkbox" name="check[]" value="Customer" /> Customer Managment (Special pricing, loyalty, customer profiling) <br /> <label>Other (Please specify below) </label> <textarea name="Message" rows="5" cols="5"></textarea> <br /> <input type="submit" name="send" value="Submit" /> <br /> <span class="style1">*</span> Iindicates a field is required</p> </form> but i cant seem to get data from the check boxes in the email.. have i missed something in my php script? I thought i was doing it right: $send = mail($to, $subject, $body, $check_msg, $headers); ? cheers for helping me on this one. -
hi, i got some issues with my contact form. basically i fill in the form and it gets emailed back with all information but no check boxes are being registered. Below is the code for the contact form: <form method="post" action="sendtraining.php"> <p> <label>Department:</label> <select name="sendto"> <option value="jasonshico@live.com.au" selected="selected">Training Department</option> </select></label> <br /> <label><span class="style1">*</span> Name</label> <input name="Name" value="Your Name" type="text" size="30" /> <label><span class="style1">*</span> Company Name</label> <input name="Company" value="Company Name" type="text" size="30" /> <label><span class="style1">*</span> Email</label> <input name="Email" value="Your Email" type="text" size="30" /> <label><span class="style1">*</span> Phone Number</label> <input name="Phone" value="Your Phone Number" type="text" size="30" /> <label>Additional Training Modules </label> <input type="checkbox" name="check[]" value="y" /> Reporting<br /> <input type="checkbox" name="check[]" value="y" /> Advanced Stock Management (Promotions, Audit trails, Deletions, Transfers etc.)<br /> <input type="checkbox" name="check[]" value="y" /> POS Training overview<br /> <input type="checkbox" name="check[]" value="y" /> Customer Managment (Special pricing, loyalty, customer profiling) <br /> <label>Other (Please specify below) </label> <textarea name="Message" rows="5" cols="5"></textarea> <br /> <input type="submit" name="send" value="Submit" /> <br /> <span class="style1">*</span> Iindicates a field is required</p> </form> and here is the send php file <?php $to = $_REQUEST['sendto']; $from = $_REQUEST['Email']; $name = $_REQUEST['Name']; $company = $_REQUEST['Company']; $phone = $_REQUEST['Phone']; $headers = "From: $from"; $subject = "RetailCare.com.au - Free Consulting Session - Conctact Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"Message"} = "Message"; $check_msg .= "Checked: $value\n"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b) { $body.=sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: noreply@retailcare.com.au"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for for your query. A Sales representitive will be in contact with you shortly!."; if($from=='') {print "You have not entered an email, please go back and try again";} if($name=='') {print "You have not entered a name, please go back and try again";} if($phone=='') {print "You have not entered a phone number, please go back and try again";} if($company=='') {print "You have not entered a company name, please go back and try again";} else { $send = mail($to, $subject, $body, $check_msg, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { header("Location: http://www.retailcare.com.au/thankyou.html"); } else { echo "We encountered an error sending your mail, please notify sales@retailcare.com.au"; } } ?> Can someone please take a look and see what im doing wrong? It would be very much appreciated. Thanks. Jase.
-
hi guys and gals, having some issues with my code with a contact form. below is my html form code <form method="post" action="sendtraining.php"> <p> <label>Department:</label> <select name="sendto"> <option value="sales@retailcare.com.au" selected="selected">Training Department</option> </select></label> <br /> <label><span class="style1">*</span> Name</label> <input name="Name" value="Your Name" type="text" size="30" /> <label><span class="style1">*</span> Company Name</label> <input name="Company" value="Company Name" type="text" size="30" /> <label><span class="style1">*</span> Email</label> <input name="Email" value="Your Email" type="text" size="30" /> <label><span class="style1">*</span> Phone Number</label> <input name="Phone" value="Your Phone Number" type="text" size="30" /> <label>Additional Training Modules </label> <input type="checkbox" name="check1" value="y" /> Reporting<br /> <input type="checkbox" name="check2" value="y" /> Advanced Stock Management (Promotions, Audit trails, Deletions, Transfers etc.)<br /> <input type="checkbox" name="check3" value="y" /> POS Training overview<br /> <input type="checkbox" name="check4" value="y" /> Customer Managment (Special pricing, loyalty, customer profiling) <br /> <label>Other (Please specify below) </label> <textarea name="Message" rows="5" cols="5"></textarea> <br /> <input type="submit" name="send" value="Submit" /> <br /> <span class="style1">*</span> Iindicates a field is required</p> </form> and below is my validation code <?php $to = $_REQUEST['sendto']; $from = $_REQUEST['Email']; $name = $_REQUEST['Name']; $company = $_REQUEST['Company']; $phone = $_REQUEST['Phone']; $headers = "From: $from"; $subject = "RetailCare.com.au - Free Consulting Session - Conctact Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"Message"} = "Message"; $check1 = $_POST['check1']; $check2 = $_POST['check2']; $check3 = $_POST['check3']; $check4 = $_POST['check4']; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b) { $body.=sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: noreply@retailcare.com.au"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for for your query. A Sales representitive will be in contact with you shortly!."; if ($check1 == "y") { $req1 = "Reporting \n" ; } if ($check2 == "y") { $req2 = "Advanced Stock Management \n"; } if ($check3 == "y") { $req3 = "POS Training overview \n"; } if ($check4 == "y") { $req4 = "Customer Managment \n"; } $req = $req1 . $req2 . $req3 . $req4 . $req5; if($from=='') {print "You have not entered an email, please go back and try again";} if($name=='') {print "You have not entered a name, please go back and try again";} if($phone=='') {print "You have not entered a phone number, please go back and try again";} if($company=='') {print "You have not entered a company name, please go back and try again";} else { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { header("Location: http://www.retailcare.com.au/thankyou.html"); } else { echo "We encountered an error sending your mail, please notify sales@retailcare.com.au"; } } ?> My problem i am having is that the check boxers arnt working, meaning if you were to fill the form out an email gets sent, but no check box information is being sent. I know i have done something wrong. Would someone please help? Thanks guys. Regards, Jason
-
thanks so much.. it worked.. you guys are the best!!! cheers, jason.
-
hi guys/gals, having some troubles with my contact form. below is the code to call the process of the mail: <!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> <title>Inzagi | Subscribe</title> <link href="style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- @import url("style.css"); body { background-color: #666666; } .style1 {color: #FFFFFF} .style3 { color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-size: 10px; } .style6 {color: #FFCC00} .style23 { font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #666666; } .style24 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #666666; } --> </style> </head> <body> <br /> <table width="500" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="7"><a href="http://www.inzagi.com.au/"></a></td> </tr> <tr> <td><div align="right"><a href="http://www.inzagi.com.au/"></a><a href="http://www.inzagi.com.au/"><img src="images/iznagi_logo.jpg" alt="Inzagi.com.au" width="146" height="71" border="0" align="left" longdesc="http://www.inzagi.com.au/" /></a></div></td> <td colspan="6"><div align="right"><span class="style1"><a href="http://www.inzagi.com.au/keylooks.html">key looks </a></span><span class="style6">|</span> <span class="style1"><a href="http://www.inzagi.com.au/stores.html">stores</a></span> <span class="style6">|</span> <span class="style1"><a href="http://www.inzagi.com.au/brands.html">brands</a></span> <span class="style6">|</span> <span class="style1"><a href="http://www.inzagi.com.au/news.html">news</a></span> <span class="style6">|</span> <span class="style1"><a href="http://www.inzagi.com.au/contactus.html">contact us </a></span></div></td> </tr> <tr> <td colspan="7"> </td> </tr> <tr> <td height="300" colspan="7" background="images/bg.jpg"><form method="post" action="process.php"> <table width="400" align="center"> <tr> <td class="style24"><div align="left">department:</div></td> <td> <div align="center"> <select name="sendto"> <option value="info@inzagi.com.au">Subscribers Dept</option> </select> </div></td> </tr> <tr> <td class="style24"><div align="left"><font color="red">*</font> name:</div></td> <td><div align="center"> <input size="25" name="Name" /> </div></td> </tr> <tr> <td class="style24"><div align="left"><font color="red">*</font> email:</div></td> <td><div align="center"> <input size="25" name="Email" /> </div></td> </tr> <tr> <td class="style24"><div align="left"><font color="red">*</font> age: </div></td> <td><div align="center"> <input size="25" name="Age" /> </div></td> </tr> <tr> <td class="style24"><div align="left"><font color="red">*</font> street: </div></td> <td><div align="center"> <input size="25" name="Street" /> </div></td> </tr> <tr> <td height="23" class="style24"><div align="left"><font color="red">*</font> suburb/state: </div></td> <td height="23"><div align="center"> <input size="25" name="Suburb" /> </div></td> </tr> <tr> <td height="23" class="style24"><div align="left"><font color="red">*</font> country: </div></td> <td height="23"><div align="center"> <input size="25" name="Country" /> </div></td> </tr> <tr> <td height="23" class="style24"><font color="red">*</font> mobile: </td> <td height="23"><div align="center"> <input size="25" name="Mobile" /> </div></td> </tr> <tr> <td colspan="2" align="center"><div align="left"> <input type="submit" name="send" value="Submit" /> </div></td> </tr> </table> </form></td> </tr> <tr> <td></td> <td></td> <td width="78"> </td> <td width="40"> </td> <td width="40"> </td> <td width="40"> </td> <td width="44"> </td> </tr> <tr> <td width="188"><div align="left"><span class="style3">© copyright 2008 Inzagi Pty Ltd</span></div></td> <td width="69"> </td> <td colspan="5"><div align="right"><a href="http://www.inzagi.com.au/subscribe.php">subscribe</a> <span class="style6">|</span> <a href="http://www.inzagi.com.au/privacy.html">privacy</a> <span class="style6">|</span> <span class="style3">powered by:</span> <a href="http://www.xicg.com">xicg.com</a> </div></td> </tr> </table> </body> </html> ok here is the process.php code: <?php $to = $_REQUEST['sendto'] ; $from = $_REQUEST['Email'] ; $name = $_REQUEST['Name'] ; $headers = "From: $from"; $subject = "Inzagi.com.au - Subscribe Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Email"} = "Email"; $fields{"Age"} = "Age"; $fields{"Street"} = "Street"; $fields{"Suburb"} = "Suburb"; $fields{"Country"} = "Country"; $fields{"Mobile"} = "Mobile"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b) { $body.=sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: noreply@inzagi.com.au"; $subject2 = "Thank you for subscribing"; $autoreply = "Thank you for subscribing"; $validForm = TRUE; if($from=='') {print "You have not entered an email, please go back and try again. "; $validForm = false;} if($Email=='') {print "You have not entered a email, please go back and try again. ";$validForm = false;} if($Age=='') {print "You have not entered a Age, please go back and try again. "; $validForm = false;} if($Street=='') {print "You have not entered a Street, please go back and try again. "; $validForm = false;} if($Suburb=='') {print "You have not entered a Suburb/State, please go back and try again. "; $validForm = false;} if($Country=='') {print "You have not entered a country, please go back and try again. "; $validForm = false;} if($Mobile=='') {print "You have not entered a mobile, please go back and try again. "; $validForm = false;} if ($validForm){ $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { header("Location: http://www.inzagi.com.au/thankyou.html"); } else { echo "We encountered an error sending your mail, please notify info@inzagi.com.au"; } } ?> after i submit this i get my error message as if i didnt enter anything in the form: You have not entered a email, please go back and try again. You have not entered a Age, please go back and try again. You have not entered a Street, please go back and try again. You have not entered a Suburb/State, please go back and try again. You have not entered a country, please go back and try again. You have not entered a mobile, please go back and try again. Even though I filled everything in. Any ideas? Your help would be very much appreciated. Regards, Jason.
-
[SOLVED] php send mail script issue. error message appearing.
cmbcorp replied to cmbcorp's topic in PHP Coding Help
mate your a great help! thanks.. -
[SOLVED] php send mail script issue. error message appearing.
cmbcorp replied to cmbcorp's topic in PHP Coding Help
doni, i did what you suggested: <?php $to = $_REQUEST['sendto'] ; $from = $_REQUEST['Email'] ; $name = $_REQUEST['Name'] ; $headers = "From: $from"; $subject = "XICG.COM - Customer Referral Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"Name1"} = "Referral Name"; $fields{"Company1"} = "Referral Company"; $fields{"Email1"} = "Referral Email"; $fields{"Phone1"} = "Referral Phone"; $fields{"Message"} = "Additional Comments"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b) { $body.=sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: noreply@xicg.com.au"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for for your referral."; if($from=='') {print "You have not entered an email, please go back and try again";} if($Name=='') {print "You have not entered a name, please go back and try again";} if($Phone=='') {print "You have not entered a phone number, please go back and try again";} if($Company=='') {print "You have not entered a company name, please go back and try again";} if($Name1=='') {print "You have not entered a company name, please go back and try again";} if($Phone1=='') {print "You have not entered a company name, please go back and try again";} if($Email1=='') {print "You have not entered a company name, please go back and try again";} if($Company1=='') {print "You have not entered a company name, please go back and try again";} else { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { header("Location: http://www.xicg.com.au/referral/thankyou.html"); } else { echo "We encountered an error sending your mail, please notify sales@xicg.com"; } } ?> Now if you dont fill in the fields, it displays the error messages, but still sends the mail.. error: You have not entered a company name, please go back and try againYou have not entered a company name, please go back and try again Warning: Cannot modify header information - headers already sent by (output started at /home/xicgca/public_html/referral/sendmail.php:33) in /home/xicgca/public_html/referral/sendmail.php on line 44 any ideas? jase. -
[SOLVED] php send mail script issue. error message appearing.
cmbcorp replied to cmbcorp's topic in PHP Coding Help
thanks doni for your input, ill keep that in mind.. -
[SOLVED] php send mail script issue. error message appearing.
cmbcorp replied to cmbcorp's topic in PHP Coding Help
thanks once again for your help.. really appriciate it. i will give it a try later. just need to know what im doing wrong with my script to avoid this in the future. can anyone else help on this? thanks... -
[SOLVED] php send mail script issue. error message appearing.
cmbcorp replied to cmbcorp's topic in PHP Coding Help
thanks for your help. i tried your code and the following error message appears: You have not entered a phone number, please go back and try againYou have not entered a company name, please go back and try againYou have not entered a company name, please go back and try againYou have not entered a email address, please go back and try againYou have not entered a phone number, please go back and try againYou have not entered a name, please go back and try again Warning: Cannot modify header information - headers already sent by (output started at /home/xicgca/public_html/referral/sendmail.php:41) in /home/xicgca/public_html/referral/sendmail.php on line 77 -
[SOLVED] php send mail script issue. error message appearing.
cmbcorp replied to cmbcorp's topic in PHP Coding Help
thanks for your reply. i have tried a few different combinations of removing those end brackets.. still no go.. any ideas guys? cheers jason.