Jump to content

cmbcorp

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Everything posted by cmbcorp

  1. 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]
  2. 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"; } } ?>
  3. 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.
  4. 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,
  5. 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.
  6. 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.
  7. 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
  8. thanks so much.. it worked.. you guys are the best!!! cheers, jason.
  9. 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.
  10. 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.
  11. 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...
  12. 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
  13. thanks for your reply. i have tried a few different combinations of removing those end brackets.. still no go.. any ideas guys? cheers jason.
  14. hi, i have recently made a contact us page and it all looks ok, but im having troubles and getting error messages. I have 3 files: sendmail.php Which has the following code: <?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: referral@xicg.com.au"; $subject2 = "Thank you for your referral"; $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";} else { if($name == '') {print "You have not entered a name, please go back and try again";} else { if($phone == '') {print "You have not entered a phone number, please go back and try again";} else { if($company == '') {print "You have not entered a company name, please go back and try again";} else { if($company1 == '') {print "You have not entered a company name, please go back and try again";} else { if($email1 == '') {print "You have not entered a email address, please go back and try again";} else { if($phone1 == '') {print "You have not entered a phone number, please go back and try again";} else { if($name1 == '') {print "You have not entered a 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 {print "We encountered an error sending your mail, please notify referral@xicg.com.au"; } } } ?> i then have my contact form page with the following 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>xicg.com - customer referral form</title> </head> <body> <a href="http://www.xicg.com/"><img src="xicg.gif" alt="XICG.COM" border="0" /></a> <form method="post" action="sendmail.php"> <table width="400" align="center"> <tr> <td colspan="2"><div align="center"> <p align="left"> </p> </div></td> </tr> <tr> <td><strong>Your Information </strong></td> <td> </td> </tr> <tr> <td><div align="left">Department:</div></td> <td><div align="left"> <select name="sendto"> <option value="sales@xicg.com">Referral Department</option> </select> </div></td> </tr> <tr> <td><div align="left"><font color="red">*</font> Name:</div></td> <td><input size="25" name="Name" /></td> </tr> <tr> <td><div align="left"><font color="red">*</font> Email:</div></td> <td><input size="25" name="Email" /></td> </tr> <tr> <td><div align="left"><font color="red">*</font> Company:</div></td> <td><input size="25" name="Company" /></td> </tr> <tr> <td><div align="left"><font color="red">*</font> Phone:</div></td> <td><input size="25" name="Phone" /></td> </tr> <tr> <td height="23"><div align="left"><strong>Your Referral </strong></div></td> <td height="23"> </td> </tr> <tr> <td height="23"><div align="left"><font color="red">*</font> Name: </div></td> <td height="23"><input size="25" name="Name1" /></td> </tr> <tr> <td height="23"><div align="left"><font color="red">*</font> Email:</div></td> <td height="23"><input size="25" name="Email1" /></td> </tr> <tr> <td height="23"><font color="red">*</font> Company:</td> <td height="23"><input size="25" name="Company1" /></td> </tr> <tr> <td height="23"><font color="red">*</font> Phone:</td> <td height="23"><input size="25" name="Phone1" /></td> </tr> <tr> <td colspan="2" align="center"><div align="left"><strong>Additional Comments: </strong></div></td> </tr> <tr> <td colspan="2" align="center"><div align="left"> <textarea name="Message" rows="5" cols="50"></textarea> </div></td> </tr> <tr> <td colspan="2" align="center"><div align="left"> <input type="submit" name="send" value="Submit" /> </div></td> </tr> <tr> <td colspan="2" align="center"><div align="left"><small>A <font color="red">*</font> indicates a field is required</small></div></td> </tr> </table> </form> </body> </html> and finally i have my thankyou.html which works fine. everytime i fill out my form i get the following error message: Parse error: syntax error, unexpected $end in /home/xicgca/public_html/referral/sendmail.php on line 50 Im not sure what im doing wrong in the sendmail script. Could someone please assist me with this? i would really appriciate it. thanks. regards, jason.
  15. hi thanks so much for your help... i tried your code and when i didnt enter something in the phone number field, it sent the email, but before it sent the email it displayed the error message : You have not entered a phone number, please go back and try again Warning: Cannot modify header information - headers already sent by (output started at /home/counteri/public_html/contact_support.php:33) in /home/counteri/public_html/contact_support.php on line 42 Not sure why its sending the email without the phone number field filled in.. any ideas? THanks for your help.. cheers
  16. HI i tried that code with the extra break, got another error message: Parse error: syntax error, unexpected $end in /home/counteri/public_html/contact_support.php on line 52 any ideas?
  17. Hi Guys/Gals, Having an issue with my php form.. Basically i want to make more than 2 fields mandatory.. Now everything worked ok with only the name and the email as mandatory, then i started playing around with it, here was the original code that "worked" <?php $to = $_REQUEST['sendto'] ; $from = $_REQUEST['Email'] ; $name = $_REQUEST['Name'] ; $headers = "From: $from"; $subject = "Counter Intelligence POS - Support Help Desk Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"ciposver"} = "CIPosVersion"; $fields{"ciofficever"} = "CIOfficeVersion"; $fields{"cios"} = "CIOperatingSystems"; $fields{"Message"} = "CIDetailedIssue"; $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@counterintelligence.com.au"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for for your query. A support representitive will be in contact with you shortly!."; if($from == '') {print "You have not entered an email, please go back and try again";} else { if($name == '') {print "You have not entered a 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.counterintelligencepos.com.au/thankyou.html" );} else {print "We encountered an error sending your mail, please notify sales@counterintelligencepos.com.au"; } } } ?> then i played around with it, this is what i done: <?php $to = $_REQUEST['sendto'] ; $from = $_REQUEST['Email'] ; $name = $_REQUEST['Name'] ; $company = $_REQUEST['Company'] ; $phone = $_REQUEST['Phone'] ; $headers = "From: $from"; $subject = "Counter Intelligence POS - Support Help Desk Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"ciposver"} = "CIPosVersion"; $fields{"ciofficever"} = "CIOfficeVersion"; $fields{"cios"} = "CIOperatingSystems"; $fields{"Message"} = "CIDetailedIssue"; $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@counterintelligence.com.au"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for for your query. A support representitive will be in contact with you shortly!."; if($from == '') {print "You have not entered an email, please go back and try again";} else { if($name == '') {print "You have not entered a name, please go back and try again";} else { if($phone == '') {print "You have not entered a phone number, please go back and try again";} else { 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.counterintelligencepos.com.au/thankyou.html" );} else {print "We encountered an error sending your mail, please notify sales@counterintelligencepos.com.au"; } } } ?> WHen i go to run my form, i get the following error message: Parse error: syntax error, unexpected $end in /home/counteri/public_html/contact_support.php on line 44 Am i doing something wrong? Not sure why i am getting these errors. Really appriciate your help guys.. Thanks. Jason.
  18. sorry i modified my comment. can i list the directory contents in a list and not on the same line? cheers
  19. mate.. thanks. that works great... one thing though it displays the dirs like this: ..[/url] NandosBendigo[/url] .[/url] NandosLysterfield[/url] NandosShepparton[/url] anyway to get the list downwords and not side ways? cheers. thanks for your help.
  20. i just added that to the code and it didnt display any files in the dir. any ideas? thanks for your help once again.
  21. Hi, I have a directory listing php script on my server and i only want to display the directorys in the list and not the files with extensions. can anyone assist me with this? i would really appreciate your help. Cheers, *** my code is as follows:*** <?php $dir = './'; if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh))!== false) { if($file <> '.' && $file <> '..') echo '<a href="'.$file.'">'.$file.'</a><br />'; } closedir($dh); } } ?>
  22. mate! your the best!!.. that works great!, thanks for all your help. cheers jase.
  23. Hi, Thanks again for your help. You guys are great! I tried your code and still the same thing.. I listed the table contents and the fields are empty still... any ideas? Cheers, Jason.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.