Dear Programmer, I need small help from your site. Below code written on my php page. <? $to = 'xyz@netsoftindia.in'; $subject = "impacterp.com website inquiry"; $name = $_REQUEST['name'] ; $comp = $_REQUEST['comp'] ; $email = $_REQUEST['email'] ; $inquiry = $_REQUEST['inquiry']; $enquiry = $_REQUEST['subject'] ; $message = "Name=".$name."\n"."Email=".$email."\n"."Requirement=".$inquiry."\n"."Company Name=".$comp."\n"."Comment=".$enquiry; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {} else {print "We encountered an error sending your mail"; } ?> $inquiry is multiple checkbox properties here is the link:- http://www.impacterp.com/enquiry.htm I need when fillin the form and check boxes then Name= fas df Email= Requirement= Banking Company Name= sf dsf sd Comment= sdf dsfsdfsda The above should be done in a table format then the format shall be very good. Don’t use = use : Requirement should have the details with comma seperated Kindly suggest me asap Thanks Asit
All your checkboxes should have the name "inquiry[]". All checked boxes will be added to that array. You process it with: for($i=0;$i<count($inquiry);$i++){ $selected = $selected . $inquiry[$i] . ", "; } PHP:
Thanks for suggestion. I made change like this <? $to = 'alok@netsoftindia.in'; $subject = "impacterp.com website inquiry"; $name = $_REQUEST['name'] ; $comp = $_REQUEST['comp'] ; $email = $_REQUEST['email'] ; for($i=0;$i<count($inquiry);$i++){ $selected = $selected . $inquiry[$i] . ", "; } $enquiry = $_REQUEST['subject'] ; $message = "Name=".$name."\n"."Email=".$email."\n"."Requirement=".$inquiry."\n"."Company Name=".$comp."\n"."Comment=".$enquiry; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {} else {print "We encountered an error sending your mail"; } ?> Please check this code, let me know it is ok or not. After submitted i got this type of mail Name=sdfsdf Email=sdfsdfsdf@dfgdfg.com Requirement= Company Name=ssdfsdf Comment=fdfgdfg Kinldy check it
Okay, caizai just got reported there Do NEVER post such advertising thingys in threads... To the thread's question: You have to change the line: $message = "Name=".$name."\n"."Email=".$email."\n"."Requirement=".$inquiry."\n"."Company Name=".$comp."\n"."Comment=".$enquiry; PHP: with: $message = "Name=".$name."\n"."Email=".$email."\n"."Requirement=".$selected."\n"."Company Name=".$comp."\n"."Comment=".$enquiry; PHP:
Still i'm getting mail like: Name=Alok Email=alok@alok.com Requirement= Company Name=netsoft Comment=testing On html page i written like this: inquiry=document.getElementById('inquiry').checked; Is it ok?
It's NOT your job to post spam/advertising in here, you won't even get a visit on your webpage by posting here. I personally wouldn't buy ANYTHING from people spamming on forums to increase their sales. I've reported you two times for those messages you wrote here. If you really got so nice products, people would visit your store automatically, and you wouldn't have to spam forums and use admins' time to ban your user. That's a pretty egoistic way of thinking you got here. You won't get long with it.
In your form element... Are you using method="post"? If you do so, please change all $_REQUEST to $_POST
NO, in form element i'm using like: <form action="enquiry1.php" name="sbi" onSubmit="return checkForm(this);">