saiinch Posted March 26, 2008 Share Posted March 26, 2008 i am getting Name, Email and Comments fields filled in my email but i am not getting the 'Inquiring about' filled in my email, whats the problem with this and how can i get all the field in my email, i need help, please somebody help me. here is the HTML code. <html dir="ltr"> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Creativo</title> <style type="text/css"> <!-- .style1 { font-family: Geneva, Arial, Helvetica, sans-serif; color: #FFFFFF; } .style2 { color: #FFFF00; font-weight: bold; } .style5 { font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; } .style7 { font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; font-size: 12px; } --> </style> <script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script> <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css"> <script type="text/javascript"> <!-- function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == ''); } } //--> </script> </head> <body bgcolor="#e61b23"> <p> </p> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="83%"> <tr> <td width="100%"> <p align="center"> <img border="0" src="logonew.gif" width="572" height="142"></td> </tr> </table> </center> </div> <br> <table width="750" border="0" align="center"> <tr> <td valign="top"><div align="center"> <h2 class="style2">Underconstruction</h2> </div></td> </tr> </table> <table width="750" border="0" align="center"> <tr> <td><span class="style1">We are now taking projects, to inquire about our services please fill in the form and we will contact you shortly.</span></td> </tr> </table> <br> <table width="750" border="0" align="center"> <tr> <td valign="top"><form action="sendmail.php" method="post" > <table width="750" border="0"> <tr> <td width="98"><span class="style7">Name:</span></td> <td width="642"><label> <input name="name" type="text" id="name" > </label></td> </tr> <tr> <td><span class="style7">Email:</span></td> <td><label> <input name="email" type="text" id="email" > </label></td> </tr> <tr> <td valign="top" class="style7">Inquiring about:</td> <td><label> <select name="message" size="3" multiple id="message"> <option id="message">Web Designing</option> <option>Graphics Designing</option> <option>Software Development</option> </select> </label></td> </tr> <tr> <td valign="top"><span class="style7">Comments:</span></td> <td><label> <textarea name="message" id="message" cols="45" rows="5"></textarea> <br> <input name="Submit" type="submit" onClick="MM_validateForm('name','','R','email','','RisEmail');return document.MM_returnValue" value="Submit"> <input type="reset" name="Reset" value="Reset"> </label></td> </tr> </table> </form> </td> </tr> </table> <script type="text/javascript"> <!-- var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1"); //--> </script> </body> </html> --------------------------------------------------------------- here is the PHP code <?php $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; mail( "my website.net", "Inquiry from Creativo Studios website.", $message, "From: $email" ); header( "Location: http://www.my website.net" ); $respond_subject = "Thank you for contacting us!"; $respond_message = "Hello! Thank you for contacting us! We will get back to you as soon as possible! Yours sincerely, My Name www.my website.net "; mail($email, $respond_subject, $respond_message); ?> Quote Link to comment https://forums.phpfreaks.com/topic/97938-i-am-having-problem-with-this/ Share on other sites More sharing options...
ansarka Posted March 26, 2008 Share Posted March 26, 2008 you are using same name 'message' for bot combo box and text area so you will get only one value in variable message rename any one of below <td><label> <select name="message" size="3" multiple id="message"> <option id="message">Web Designing</option> <option>Graphics Designing</option> <option>Software Development</option> </select> </label></td> </tr> <tr> <td valign="top"><span class="style7">Comments:</span></td> <td><label> <textarea name="message" id="message" cols="45" rows="5"></textarea> Quote Link to comment https://forums.phpfreaks.com/topic/97938-i-am-having-problem-with-this/#findComment-501055 Share on other sites More sharing options...
saiinch Posted March 26, 2008 Author Share Posted March 26, 2008 thank your for your reply but it still not working, do you have any idea how to make it work properly. this is new PHP code. <?php $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; mail( "info@creativostudios.net", "Inquiry from Creativo Studios website.", $message, "From: $email" ); header( "Location: http://www.creativostudios.net" ); $respond_subject = "Thank you for contacting us!"; $respond_message = "Hello! Thank you for contacting us! We will get back to you as soon as possible! Yours sincerely, Saad Khalid Khan www.creativostudios.net "; mail($email, $respond_subject, $respond_message); ?> ------------------------------------------------------- this is the new 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=utf-8" /> <title>Untitled Document</title> </head> <body> <table width="520" border="0"> <tr> <td width="514"><form method="post" action="send_mail.php"> <table width="470" border="0"> <tr> <td width="107">Name:</td> <td width="353"><label> <input type="text" name="name" id="name" /> </label></td> </tr> <tr> <td>Email:</td> <td><label> <input type="text" name="email" id="email" /> </label></td> </tr> <tr> <td valign="top">Inquiring about:</td> <td><label> <select name="inquiry" size="3" multiple="multiple" id="inquiry"> <option value="Web">Web Designing</option> <option value="Graphics">Graphics Designing</option> <option value="Software">Software Development</option> </select> </label></td> </tr> <tr> <td valign="top">Message:</td> <td><label> <textarea name="message" id="message" cols="45" rows="5"></textarea> </label></td> </tr> <tr> <td valign="top"> </td> <td><label> <input type="submit" name="Submit" id="Submit" value="Submit" /> </label></td> </tr> </table> </form> </td> </tr> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/97938-i-am-having-problem-with-this/#findComment-501073 Share on other sites More sharing options...
ansarka Posted March 26, 2008 Share Posted March 26, 2008 <?php $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $inquiry=$_REQUEST['inquiry']; $inquiry=@implode(",",$inquiry); $finalmessage='Inquiry For : '.$inquiry.' <br> $message'; mail( "info@creativostudios.net", "Inquiry from Creativo Studios website.", $finalmessage, "From: $email" ); $respond_subject = "Thank you for contacting us!"; $respond_message = "Hello! Thank you for contacting us! We will get back to you as soon as possible! Yours sincerely, Saad Khalid Khan www.creativostudios.net "; mail($email, $respond_subject, $respond_message); header( "Location: http://www.creativostudios.net" ); ?> ------------------------------------------------------- this is the new 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=utf-8" /> <title>Untitled Document</title> </head> <body> <table width="520" border="0"> <tr> <td width="514"><form method="post" action="send_mail.php"> <table width="470" border="0"> <tr> <td width="107">Name:</td> <td width="353"><label> <input type="text" name="name" id="name" /> </label></td> </tr> <tr> <td>Email:</td> <td><label> <input type="text" name="email" id="email" /> </label></td> </tr> <tr> <td valign="top">Inquiring about:</td> <td><label> <select name="inquiry[]" size="3" multiple="multiple" id="inquiry"> <option value="Web">Web Designing</option> <option value="Graphics">Graphics Designing</option> <option value="Software">Software Development</option> </select> </label></td> </tr> <tr> <td valign="top">Message:</td> <td><label> <textarea name="message" id="message" cols="45" rows="5"></textarea> </label></td> </tr> <tr> <td valign="top"> </td> <td><label> <input type="submit" name="Submit" id="Submit" value="Submit" /> </label></td> </tr> </table> </form> </td> </tr> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/97938-i-am-having-problem-with-this/#findComment-501078 Share on other sites More sharing options...
saiinch Posted March 26, 2008 Author Share Posted March 26, 2008 hey friend thanks for your quick reply. I applied the PHP code your supplied but i am getting this in my email message "Inquiry For : <br> $message" i am not getting the message written in the form. Can you please help me in this ? Quote Link to comment https://forums.phpfreaks.com/topic/97938-i-am-having-problem-with-this/#findComment-501093 Share on other sites More sharing options...
ansarka Posted March 26, 2008 Share Posted March 26, 2008 change the line $finalmessage='Inquiry For : '.$inquiry.' <br> $message'; to $finalmessage='Inquiry For : '.$inquiry.' <br>'. $message; Quote Link to comment https://forums.phpfreaks.com/topic/97938-i-am-having-problem-with-this/#findComment-501098 Share on other sites More sharing options...
ansarka Posted March 26, 2008 Share Posted March 26, 2008 change the line $finalmessage='Inquiry For : '.$inquiry.'<br> $message'; to $finalmessage='Inquiry For : '.$inquiry.'<br>'. $message; Quote Link to comment https://forums.phpfreaks.com/topic/97938-i-am-having-problem-with-this/#findComment-501101 Share on other sites More sharing options...
ansarka Posted March 26, 2008 Share Posted March 26, 2008 and also the select box name should be array like below <select name="inquiry[]" size="3" multiple="multiple" id="inquiry"> Quote Link to comment https://forums.phpfreaks.com/topic/97938-i-am-having-problem-with-this/#findComment-501102 Share on other sites More sharing options...
lordfrikk Posted March 26, 2008 Share Posted March 26, 2008 Using $_REQUEST superglobal is not secure. I'd recommend avoiding it if possible. Quote Link to comment https://forums.phpfreaks.com/topic/97938-i-am-having-problem-with-this/#findComment-501103 Share on other sites More sharing options...
saiinch Posted March 26, 2008 Author Share Posted March 26, 2008 *i am editing this post* i got it working Thank you so much this is what i am getting in my email Inquiry For : Web,Graphics<br>now is it working ? secondly i don't know anything about PHP so i am taking help from online tutorials and forum, can you please mention me what should i use except $_REQUEST Quote Link to comment https://forums.phpfreaks.com/topic/97938-i-am-having-problem-with-this/#findComment-501104 Share on other sites More sharing options...
lordfrikk Posted March 26, 2008 Share Posted March 26, 2008 You can use $_GET or $_POST, depends on what form method did you use. Quote Link to comment https://forums.phpfreaks.com/topic/97938-i-am-having-problem-with-this/#findComment-501534 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.