logicsound Posted June 22, 2010 Share Posted June 22, 2010 1st post so be easy with me...googled and searched but could not find an exact answer. My client would like to cc the form poster. I am not really worried about an option to do this I would just like to hard code it in the form to pull the data from the email form and email them a copy. Here is my code that is on my page that the form posts to <?PHP $email = $HTTP_POST_VARS; $mailto = "[email protected]"; $mailsubj = "LOI"; $mailhead = "From: LOI"; reset ($HTTP_POST_VARS); $mailbody = "Values submitted from LOI:\n"; while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($mailto, $mailsubj, $mailbody, $mailhead); </SCRIPT> <META HTTP-EQUIV="Refresh" Content="5000; URL=index.html"> </td> </tr> </table> <span class="style2"> and this is the section of code on my form page that I want to email too <tr> <td align="right" bgcolor="#660000"><span class="style3">Contact Email</span></td> <td bgcolor="#CCCCCC"><span id="sprytextfield5"> <input name="EMAIL" type="text" id="EMAIL"> <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td> So I need the code to capture ID "email" and put that in my php thanks Trevor Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/ Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 in the form itself, add in a check box to add carbon copy then in your headers you can use all of these things: $headers = "From: [email protected]\r\n"; $headers .= "Reply-To: [email protected]\r\n"; $headers .= "Return-Path: [email protected]\r\n"; $headers .= "CC: [email protected]\r\n"; $headers .= "BCC: [email protected]\r\n"; Hope it helps out. edit: remember that you get your data from the form using $_POST so to extract the email address you get that through $email = $_POST['EMAIL']; then to add the headers in your case you would do: $mailhead .="CC: ".$email."\r\n"; but remember to add the \r\n to your other mail head or it wont really work. Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075627 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 ok but what code do I need to give thee cc checkbox ? so it links to send a cc email. also in your code example you have $headers .= "CC: [email protected]\r\n"; but this email address is going to change depending on what the user puts in there email field so what is the php code so I can pull the data from my ID email in the form Thanks!! Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075630 Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 the CC checkbox would be just regular HTML for a check box.. nothing special. I edited my other post for you... you only need the checkbox if you want to give the end user the option of having it sent to them as well otherwise you dont need it. Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075637 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 ok not to good with php so let me see if I got this right. add this $mailhead .="CC: ".$email."\r\n"; so do I add this too $email = $_POST['EMAIL']; or do I change the one I got to that? sorry for being so dumb... Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075642 Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 hey i was there once too... these are the 2 lines you'll change.. one is just a change, one is an addition... $mailhead = "From: LOI\r\n"; $mailhead = "CC: ".$_POST['EMAIL']."\r\n"; simple eh? Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075645 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 <?PHP $email = $HTTP_POST_VARS; $mailto = "[email protected]"; $mailsubj = "LOI"; $mailhead = "From: LOI\r\n"; $mailhead = "CC: ".$_POST['EMAIL']."\r\n"; reset ($HTTP_POST_VARS); $mailbody = "Values submitted from LOI:\n"; while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($mailto, $mailsubj, $mailbody, $mailhead); I never recieved the cc email is the reason I ask. Thanks so much for your help!! Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075658 Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 btw, im not setting any form tags with an action? The best practices would to have something like this: <form name="myform" action="sendmail.php"> -- add tables and input boxes here -- </form> then in your sendmail.php doing something like this: <?php $to = [email protected] $from = $_POST['email']; $sub = "LOI"; $mailhead .= "FROM: LOI\r\n"; $mailhead .= "CC: ".$_POST['EMAIL']."\r\n"; $mailbody = "Values submitted from LOI:\n"; while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($to, $subj, $mailbody, $mailhead); ?> Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075668 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 yep, I have the form tags. The form does send the email to the [email protected] address just not getting the cc yet. Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075674 Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 alright add this to the bottom of your PHP file... echo '<pre>'; print_r($_POST); echo '<pre>'; submit the form and make sure that everything is being submit correctly. Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075677 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 hmm, when I insert that code, everything gets screwed up. any chance you can look the webpage? its http://leonlevinefoundation.org/inquiry.html Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075685 Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 everything looks right to me, whats it say or do when you submit the form? Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075706 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 it shows the form data on the page.. where exactly do I put that code you gave me? in the php file with my mailhead code? do I put it after the mailhead? Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075708 Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 thats what its supposed to do, copy that form data and post it here for me to look at... Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075709 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- Design / code / css by Nadia www.perrelink.com.au --> <html> <head> <title>The Leon Levine Foundation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_showHideLayers() { //v6.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; } obj.visibility=v; } } //--> </script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } //--> </script> <link href="css/global.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- .style2 {font-size: 24px} --> </style> <link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css"> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- .style3 { color: #FFFFFF } .style13 {color: #666666} --> </style> </head> <body> <!-- Wrapper div seeing stylesheet for styling --> <div id="wrapper"> <!-- Dropdown Div on button 3- see stylesheet for styling and positioning--> <div id="dropdown3"> <table width="150" border="0" cellpadding="0" cellspacing="0" class="menu"> <tr> <td><a href="grants.html#health">Healthcare </a></td> </tr> <tr> <td><a href="grants.html#education">Education</a></td> </tr> <tr> <td><a href="grants.html#jewish">Jewish Religon</a></td> </tr> <tr> <td><a href="grants.html#human">Human Services</a></td> </tr> <tr> <td><a href="grants.html#Emerging">Emerging Issues</a></td> </tr> </table> </div> <!-- end of dropdown 3 --> <!-- Dropdown 4 div - see stylesheet for styling and positioning --> <div id="dropdown4"> <table width="150" border="0" cellpadding="0" cellspacing="0" class="menu"> <tr> <td><a href="#">Guidelines</a></td> </tr> <tr> <td><a href="#">Eligibility</a></td> </tr> <tr> <td><a href="faq.html">Faq's</a></td> </tr> </table> </div> <!-- End of Dropdown 4 --> <!-- This is the closer div - mousing over this closes the dropdowns --> <div id="closer"><a href="javascript:;" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/shim.gif" alt="" width="700" height="190" border="0"></a> </div> <!-- end of closer div --> </div> <table width="750" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <!-- topleftside image --> <td valign="top"><!-- company name table --> <table width="750" border="0" cellpadding="0" cellspacing="0" id="logotbl"> <tr> <!-- here we have set the show-hide behaviour to the header images, so that if someone mouses over these images the dropdown menus will hide - all explained in the help docs --> <td><a href="index.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/logo.gif" alt="" width="750" height="84" border="0" title=""></a></td> </tr> </table> <!-- end logo table --> <!-- navbar table --> <table width="750" border="0" cellpadding="0" cellspacing="0" id="navbar"> <tr> <td width="120" height="25"><a href="aboutus.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/buttons/button1.gif" alt="" name="button1" width="120" height="25" border="0" id="button1" title=""></a></td> <td><a href="mission.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button2.gif" alt="" name="button2" width="120" height="25" border="0" id="button2" title=""></a></td> <td><a href="grants.html" onMouseOver="MM_showHideLayers('dropdown3','','show','dropdown4','','hide','closer','','show')"> <img src="graphics/buttons/button3.gif" alt="" name="button3" width="120" height="25" border="0" id="button3" title=""></a></td> <td><a href="apply.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','show','closer','','show')"> <img src="graphics/buttons/button4.gif" alt="" name="button4" width="120" height="25" border="0" id="button4" title=""></a></td> <td><a href="news.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button5.gif" alt="" name="button5" width="120" height="25" border="0" id="button5" title=""></a></td> <td><a href="contactus.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button6.gif" alt="" name="button6" width="120" height="25" border="0" id="button6" title=""></a></td> <td width="100%"> </td> </tr> </table></td> <!-- outer table image topright side --> </tr> <tr> <!-- outer table middle graphic --> <td valign="top"><!--begin slogan content area - lady and company slogan area--> <table border="0" cellpadding="0" cellspacing="0" id="slogansection"> <tr> <td><img src="graphics/midsection.jpg" alt="" width="750" height="212" border="0"></td> </tr> </table></td> <!-- outer table image rightside middle --> </tr> <tr valign="top"> <!-- end of mid slogan area --> <!-- start of main content area --> <td height="546"><table width="750" border="0" cellpadding="0" cellspacing="0" id="contenttable"> <tr> <td width="750" valign="top"><h1 align="center"><strong><em> Letter of Inquiry</em></strong></h1> <p> </p> <form action="letter.php" method="post" name="letterofinquiry" id="letterofinquiry"> <table width="700" border="0"> <tr> <td align="right" bgcolor="#660000"><span class="style3">Organization Legal Name</span></td> <td bgcolor="#CCCCCC"><span id="sprytextfield1"> <input name="ORGANIZATION" type="text" id="ORGANIZATION" size="50"> <span class="textfieldRequiredMsg">A value is required.</span></span></td> </tr> <tr> <td align="right" bgcolor="#660000"><span class="style3">Name of Program Requested</span></td> <td bgcolor="#CCCCCC"><span id="sprytextfield2"> <input name="PROJECT" type="text" id="PROJECT" size="50"> <span class="textfieldRequiredMsg">A value is required.</span></span></td> </tr> <tr> <td align="right" bgcolor="#660000"><span class="style3">Contact Name</span></td> <td bgcolor="#CCCCCC"><span id="sprytextfield3"> <input name="NAME" type="text" id="NAME" size="50"> <span class="textfieldRequiredMsg">A value is required.</span></span></td> </tr> <tr> <td align="right" bgcolor="#660000"><span class="style3">Contact Address</span></td> <td bgcolor="#CCCCCC"><span id="sprytextarea5"> <textarea name="ADDRESS" id="ADDRESS" cols="45" rows="5"></textarea> <span class="textareaRequiredMsg">A value is required.</span></span></td> </tr> <tr> <td align="right" bgcolor="#660000"><span class="style3">Contact Email</span></td> <td bgcolor="#CCCCCC"><span id="sprytextfield5"> <input name="EMAIL" type="text" id="EMAIL"> <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td> </tr> <tr> <td align="right" bgcolor="#660000"><span class="style3">Contact Phone </span></td> <td bgcolor="#CCCCCC"><span id="sprytextfield6"> <input name="PHONE" type="text" id="PHONE" size="12"> <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td> </tr> <tr> <td align="right" valign="top" bgcolor="#660000"><span class="style3">Please choose all that apply</span></td> <td bgcolor="#CCCCCC"><p><strong>The Leon Levine Foundation seeks to improve and advance the human condition in four major areas: Religion, Education, Healthcare and Human Services. It therefore exists to support individuals and institutions seeking to accomplish the following:</strong> </p> <p> <input name="HEALTHCARE" type="checkbox" id="HEALTHCARE" value="Supporting the physically, mentally or emotionally ill through medical assistance and scientific research"> <strong>Supporting the physically, mentally or emotionally ill through medical assistance and scientific research.</strong></p> <p><strong> <input name="EDUCATION" type="checkbox" id="EDUCATION" value="Pursuing academic excellence and providing access for disadvantaged and deserving individuals;"> </strong><strong>Pursuing academic excellence and providing access for disadvantaged and deserving individuals;</strong></p> <p> <input name="RELIGON" type="checkbox" id="RELIGON" value="Building Jewish identity and strengthening Jewish Communities locally and worldwide;"> <strong>Building Jewish identity and strengthening Jewish Communities locally and worldwide;</strong></p> <p> <input type="checkbox" name="HUMAN SERVICES" id="HUMAN SERVICES"> <strong>Eliminating homelessness, alleviating personal crisis, supporting cultural activities and improving the lives of families, children and the elderly.</strong></p> <p> <input name="OTHER" type="checkbox" id="OTHER" value="Responding to other emerging issues which could have a significant impact on society."> <strong>Responding to other emerging issues which could have a significant impact on society.</strong></p></td> </tr> <tr> <td align="right" bgcolor="#660000"><span class="style3">Describe how your organization or program fits into the mission of TLLF(350 character limit)</span></td> <td bgcolor="#CCCCCC"><span id="sprytextarea1"> <textarea name="MISSION" id="MISSION" cols="45" rows="10"></textarea> <span id="countsprytextarea1"> </span> <span class="textareaRequiredMsg">A value is required.</span><span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></span></td> </tr> <tr> <td align="right" bgcolor="#660000"><span class="style3">Provide a summary of your organization and why it exists (1,000 character li<span class="style3">mit</span>)</span></td> <td bgcolor="#CCCCCC"><span id="sprytextarea2"> <textarea name="SUMMARY" cols="45" rows="15" id="SUMMARY"></textarea> <span id="countsprytextarea2"> </span> <span class="textareaRequiredMsg">A value is required.</span><span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></span></td> </tr> <tr> <td align="right" bgcolor="#660000"><span class="style3">Describe the program for which you will request support, why the program is necessary and what impact is expected (1,000 character limit)</span></td> <td bgcolor="#CCCCCC"><span id="sprytextarea3"> <textarea name="PROGRAM" cols="45" rows="15" id="PROGRAM"></textarea> <span id="countsprytextarea3"> </span> <span class="textareaRequiredMsg">A value is required.</span><span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></span></td> </tr> <tr> <td align="right" bgcolor="#660000"><span class="style3">Describe the financial challenges you face to achieve the above</span></td> <td bgcolor="#CCCCCC"><span id="sprytextarea4"> <textarea name="NEED" cols="45" rows="10" id="NEED"></textarea> <span id="countsprytextarea4"> </span> <span class="textareaRequiredMsg">A value is required.</span><span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></span></td> </tr> <tr> <td align="right" bgcolor="#660000"> </td> <td bgcolor="#CCCCCC"><div align="left"> <input type="submit" value="Submit"> </div></td> </tr> </table> </form> <p> </p> <p> </p> <p> </p></td> </tr> </table> <span class="style2"> <!-- end of content area --> <!-- begin text link area --> </span> <table width="100%" border="0" cellpadding="0" cellspacing="0" id="linkbar"> <tr> <td align="center" class="style2"><p><a href="index.html">Home</a> |<a href="contactus.html"> Contact Us</a></p> <p><span class="footertext">Leon Levine Foundation Copyright © 2009 Site design by</span> <a href="http://www.groupcci.com" class="style13">Group CCI</a></p> <p> </p></td> </tr> </table></tr> </table> <script type="text/javascript"> <!-- var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1"); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2"); var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3"); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "email"); var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "phone_number", {useCharacterMasking:true}); var sprytextarea2 = new Spry.Widget.ValidationTextarea("sprytextarea2", {maxChars:1000, counterType:"chars_remaining", counterId:"countsprytextarea2"}); var sprytextarea3 = new Spry.Widget.ValidationTextarea("sprytextarea3", {maxChars:1000, counterType:"chars_remaining", counterId:"countsprytextarea3"}); var sprytextarea4 = new Spry.Widget.ValidationTextarea("sprytextarea4", {maxChars:350, counterType:"chars_remaining", counterId:"countsprytextarea4"}); var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1", {maxChars:350, counterType:"chars_remaining", counterId:"countsprytextarea1"}); var sprytextarea5 = new Spry.Widget.ValidationTextarea("sprytextarea5"); //--> </script> </body> </html> Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075712 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 and this is the page it posts too <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>The Leon Levine Foundation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_showHideLayers() { //v6.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; } obj.visibility=v; } } //--> </script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } //--> </script> <link href="css/global.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- .style2 {font-size: 24px} .style7 { font-size: 18px; font-weight: bold; font-style: italic; } .style10 {font-size: 14px; font-weight: bold; font-style: italic; } .style11 {font-size: 14px} .style12 {font-size: 16px; font-weight: bold; font-style: italic; } --> </style> </head> <body> <!-- Wrapper div seeing stylesheet for styling --> <div id="wrapper"> <!-- Dropdown Div on button 3- see stylesheet for styling and positioning--> <div id="dropdown3"> <table width="150" border="0" cellpadding="0" cellspacing="0" class="menu"> <tr> <td><a href="grants.html#health">Healthcare </a></td> </tr> <tr> <td><a href="grants.html#education">Education</a></td> </tr> <tr> <td><a href="grants.html#jewish">Jewish Religon</a></td> </tr> <tr> <td><a href="grants.html#human">Human Services</a></td> </tr> <tr> <td><a href="grants.html#Emerging">Emerging Issues</a></td> </tr> </table> </div> <!-- end of dropdown 3 --> <!-- Dropdown 4 div - see stylesheet for styling and positioning --> <div id="dropdown4"> <table width="150" border="0" cellpadding="0" cellspacing="0" class="menu"> <tr> <td><a href="apply.html#guidelines">Guidelines</a></td> </tr> <tr> <td><a href="apply.html#eligibility">Eligibility</a></td> </tr> <tr> <td><a href="faq.html">Faq's</a></td> </tr> </table> </div> <!-- End of Dropdown 4 --> <!-- This is the closer div - mousing over this closes the dropdowns --> <div id="closer"><a href="javascript:;" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/shim.gif" alt="" width="700" height="190" border="0"></a> </div> <!-- end of closer div --> </div> <table width="750" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <!-- topleftside image --> <td valign="top"><!-- company name table --> <table width="750" border="0" cellpadding="0" cellspacing="0" id="logotbl"> <tr> <!-- here we have set the show-hide behaviour to the header images, so that if someone mouses over these images the dropdown menus will hide - all explained in the help docs --> <td><a href="index.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/logo.gif" alt="" width="750" height="84" border="0" title=""></a></td> </tr> </table> <!-- end logo table --> <!-- navbar table --> <table width="750" border="0" cellpadding="0" cellspacing="0" id="navbar"> <tr> <td width="120" height="25"><a href="aboutus.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/buttons/button1.gif" alt="" name="button1" width="120" height="25" border="0" id="button1" title=""></a></td> <td><a href="mission.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button2.gif" alt="" name="button2" width="120" height="25" border="0" id="button2" title=""></a></td> <td><a href="grants.html" onMouseOver="MM_showHideLayers('dropdown3','','show','dropdown4','','hide','closer','','show')"> <img src="graphics/buttons/button3.gif" alt="" name="button3" width="120" height="25" border="0" id="button3" title=""></a></td> <td><a href="apply.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','show','closer','','show')"> <img src="graphics/buttons/button4.gif" alt="" name="button4" width="120" height="25" border="0" id="button4" title=""></a></td> <td><a href="news.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button5.gif" alt="" name="button5" width="120" height="25" border="0" id="button5" title=""></a></td> <td><a href="contactus.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button6.gif" alt="" name="button6" width="120" height="25" border="0" id="button6" title=""></a></td> <td width="100%"> </td> </tr> </table></td> <!-- outer table image topright side --> </tr> <tr> <!-- outer table middle graphic --> <td valign="top"><!--begin slogan content area - lady and company slogan area--> <table border="0" cellpadding="0" cellspacing="0" id="slogansection"> <tr> <td><img src="graphics/midsection.jpg" alt="" width="750" height="212" border="0"></td> </tr> </table></td> <!-- outer table image rightside middle --> </tr> <tr valign="top"> <!-- end of mid slogan area --> <!-- start of main content area --> <td height="546"><table width="750" border="0" cellpadding="0" cellspacing="0" id="contenttable"> <tr> <td width="750" valign="top"><h1 align="center"> <p>You may submit additional materials you feel may be helpful to the LOI to:</p> <p align="center">The Leon Levine Foundation<br> ATTN: Grants Administration<br> 6000 Fairview Rd. Suite 1525<br> Charlotte, NC 28210</p> <p align="center"> </p> <p align="center"> </p> <ul> <p><br> <br> <br> <br> <br> <br> <br> <br> </p> <h1 align="center"> </h1> <p><br> <br> <br> </p> <?PHP $email = $HTTP_POST_VARS; $mailto = "[email protected]"; $mailsubj = "LOI"; $mailhead = "From: LOI\r\n"; $mailhead = "CC: ".$_POST['EMAIL']."\r\n"; reset ($HTTP_POST_VARS); $mailbody = "Values submitted from LOI:\n"; while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($mailto, $mailsubj, $mailbody, $mailhead); echo '<pre>'; print_r($_POST); echo '<pre>'; </SCRIPT> <META HTTP-EQUIV="Refresh" Content="5000; URL=index.html"> </td> </tr> </table> <span class="style2"> <!-- end of content area --> <!-- begin text link area --> </span> <table width="100%" border="0" cellpadding="0" cellspacing="0" id="linkbar"> <tr> <td align="center" class="style2"><p><a href="index.html">Home</a> |<a href="contactus.html"> Contact Us</a></p> <p>Leon Levine Foundation Copyright © 2009</p> <p> </p></td> </tr> </table></tr> </table> </body> </html> Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075713 Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 k give me a few moments, i will re-write your letter.php and give you the source for a brand new page to add and this shall work for you. Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075714 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>The Leon Levine Foundation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_showHideLayers() { //v6.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; } obj.visibility=v; } } //--> </script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } //--> </script> <link href="css/global.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- .style2 {font-size: 24px} .style7 { font-size: 18px; font-weight: bold; font-style: italic; } .style10 {font-size: 14px; font-weight: bold; font-style: italic; } .style11 {font-size: 14px} .style12 {font-size: 16px; font-weight: bold; font-style: italic; } --> </style> </head> <body> <!-- Wrapper div seeing stylesheet for styling --> <div id="wrapper"> <!-- Dropdown Div on button 3- see stylesheet for styling and positioning--> <div id="dropdown3"> <table width="150" border="0" cellpadding="0" cellspacing="0" class="menu"> <tr> <td><a href="grants.html#health">Healthcare </a></td> </tr> <tr> <td><a href="grants.html#education">Education</a></td> </tr> <tr> <td><a href="grants.html#jewish">Jewish Religon</a></td> </tr> <tr> <td><a href="grants.html#human">Human Services</a></td> </tr> <tr> <td><a href="grants.html#Emerging">Emerging Issues</a></td> </tr> </table> </div> <!-- end of dropdown 3 --> <!-- Dropdown 4 div - see stylesheet for styling and positioning --> <div id="dropdown4"> <table width="150" border="0" cellpadding="0" cellspacing="0" class="menu"> <tr> <td><a href="apply.html#guidelines">Guidelines</a></td> </tr> <tr> <td><a href="apply.html#eligibility">Eligibility</a></td> </tr> <tr> <td><a href="faq.html">Faq's</a></td> </tr> </table> </div> <!-- End of Dropdown 4 --> <!-- This is the closer div - mousing over this closes the dropdowns --> <div id="closer"><a href="javascript:;" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/shim.gif" alt="" width="700" height="190" border="0"></a> </div> <!-- end of closer div --> </div> <table width="750" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <!-- topleftside image --> <td valign="top"><!-- company name table --> <table width="750" border="0" cellpadding="0" cellspacing="0" id="logotbl"> <tr> <!-- here we have set the show-hide behaviour to the header images, so that if someone mouses over these images the dropdown menus will hide - all explained in the help docs --> <td><a href="index.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/logo.gif" alt="" width="750" height="84" border="0" title=""></a></td> </tr> </table> <!-- end logo table --> <!-- navbar table --> <table width="750" border="0" cellpadding="0" cellspacing="0" id="navbar"> <tr> <td width="120" height="25"><a href="aboutus.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/buttons/button1.gif" alt="" name="button1" width="120" height="25" border="0" id="button1" title=""></a></td> <td><a href="mission.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button2.gif" alt="" name="button2" width="120" height="25" border="0" id="button2" title=""></a></td> <td><a href="grants.html" onMouseOver="MM_showHideLayers('dropdown3','','show','dropdown4','','hide','closer','','show')"> <img src="graphics/buttons/button3.gif" alt="" name="button3" width="120" height="25" border="0" id="button3" title=""></a></td> <td><a href="apply.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','show','closer','','show')"> <img src="graphics/buttons/button4.gif" alt="" name="button4" width="120" height="25" border="0" id="button4" title=""></a></td> <td><a href="news.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button5.gif" alt="" name="button5" width="120" height="25" border="0" id="button5" title=""></a></td> <td><a href="contactus.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button6.gif" alt="" name="button6" width="120" height="25" border="0" id="button6" title=""></a></td> <td width="100%"> </td> </tr> </table></td> <!-- outer table image topright side --> </tr> <tr> <!-- outer table middle graphic --> <td valign="top"><!--begin slogan content area - lady and company slogan area--> <table border="0" cellpadding="0" cellspacing="0" id="slogansection"> <tr> <td><img src="graphics/midsection.jpg" alt="" width="750" height="212" border="0"></td> </tr> </table></td> <!-- outer table image rightside middle --> </tr> <tr valign="top"> <!-- end of mid slogan area --> <!-- start of main content area --> <td height="546"><table width="750" border="0" cellpadding="0" cellspacing="0" id="contenttable"> <tr> <td width="750" valign="top"><h1 align="center"> <p>You may submit additional materials you feel may be helpful to the LOI to:</p> <p align="center">The Leon Levine Foundation<br> ATTN: Grants Administration<br> 6000 Fairview Rd. Suite 1525<br> Charlotte, NC 28210</p> <p align="center"> </p> <p align="center"> </p> <ul> <p><br> <br> <br> <br> <br> <br> <br> <br> </p> <h1 align="center"> </h1> <p><br> <br> <br> </p> <?PHP $email = $HTTP_POST_VARS; $mailto = "[email protected]"; $mailsubj = "LOI"; $mailhead = "From: LOI\r\n"; $mailhead = "CC: ".$_POST['EMAIL']."\r\n"; reset ($HTTP_POST_VARS); $mailbody = "Values submitted from LOI:\n"; while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($mailto, $mailsubj, $mailbody, $mailhead); echo '<pre>'; print_r($_POST); echo '<pre>'; </SCRIPT> <META HTTP-EQUIV="Refresh" Content="5000; URL=index.html"> </td> </tr> </table> <span class="style2"> <!-- end of content area --> <!-- begin text link area --> </span> <table width="100%" border="0" cellpadding="0" cellspacing="0" id="linkbar"> <tr> <td align="center" class="style2"><p><a href="index.html">Home</a> |<a href="contactus.html"> Contact Us</a></p> <p>Leon Levine Foundation Copyright © 2009</p> <p> </p></td> </tr> </table></tr> </table> </body> </html> Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075715 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 and here is what I put in the other file that that posts to <?PHP $email = $HTTP_POST_VARS; $mailto = "[email protected]"; $mailsubj = "LOI"; $mailhead = "From: LOI\r\n"; $mailhead = "CC: ".$_POST['EMAIL']."\r\n"; reset ($HTTP_POST_VARS); $mailbody = "Values submitted from LOI:\n"; while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($mailto, $mailsubj, $mailbody, $mailhead); echo '<pre>'; print_r($_POST); echo '<pre>'; Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075718 Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 okay first off, here is your new letter.php <?php $email = $_POST['EMAIL']; $mailto = '[email protected]'; $mailsubj = "LOI"; $mailhead .= "FROM: LOI\r\n"; $mailhead .= "CC: ".$email."\r\n"; $mailbody = "Values submitted from LOI:\n"; while (list($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($mailto, $mailsubj, $mailbody, $mailhead); header("LOCATION: letter.html"); ?> copy that exactly as is... and here is your new page, letter.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>The Leon Levine Foundation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_showHideLayers() { //v6.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; } obj.visibility=v; } } //--> </script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } //--> </script> <link href="css/global.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- .style2 {font-size: 24px} .style7 { font-size: 18px; font-weight: bold; font-style: italic; } .style10 {font-size: 14px; font-weight: bold; font-style: italic; } .style11 {font-size: 14px} .style12 {font-size: 16px; font-weight: bold; font-style: italic; } --> </style> </head> <body> <!-- Wrapper div seeing stylesheet for styling --> <div id="wrapper"> <!-- Dropdown Div on button 3- see stylesheet for styling and positioning--> <div id="dropdown3"> <table width="150" border="0" cellpadding="0" cellspacing="0" class="menu"> <tr> <td><a href="grants.html#health">Healthcare </a></td> </tr> <tr> <td><a href="grants.html#education">Education</a></td> </tr> <tr> <td><a href="grants.html#jewish">Jewish Religon</a></td> </tr> <tr> <td><a href="grants.html#human">Human Services</a></td> </tr> <tr> <td><a href="grants.html#Emerging">Emerging Issues</a></td> </tr> </table> </div> <!-- end of dropdown 3 --> <!-- Dropdown 4 div - see stylesheet for styling and positioning --> <div id="dropdown4"> <table width="150" border="0" cellpadding="0" cellspacing="0" class="menu"> <tr> <td><a href="apply.html#guidelines">Guidelines</a></td> </tr> <tr> <td><a href="apply.html#eligibility">Eligibility</a></td> </tr> <tr> <td><a href="faq.html">Faq's</a></td> </tr> </table> </div> <!-- End of Dropdown 4 --> <!-- This is the closer div - mousing over this closes the dropdowns --> <div id="closer"><a href="javascript:;" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/shim.gif" alt="" width="700" height="190" border="0"></a> </div> <!-- end of closer div --> </div> <table width="750" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <!-- topleftside image --> <td valign="top"><!-- company name table --> <table width="750" border="0" cellpadding="0" cellspacing="0" id="logotbl"> <tr> <!-- here we have set the show-hide behaviour to the header images, so that if someone mouses over these images the dropdown menus will hide - all explained in the help docs --> <td><a href="index.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/logo.gif" alt="" width="750" height="84" border="0" title=""></a></td> </tr> </table> <!-- end logo table --> <!-- navbar table --> <table width="750" border="0" cellpadding="0" cellspacing="0" id="navbar"> <tr> <td width="120" height="25"><a href="aboutus.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide','closer','','hide')"><img src="graphics/buttons/button1.gif" alt="" name="button1" width="120" height="25" border="0" id="button1" title=""></a></td> <td><a href="mission.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button2.gif" alt="" name="button2" width="120" height="25" border="0" id="button2" title=""></a></td> <td><a href="grants.html" onMouseOver="MM_showHideLayers('dropdown3','','show','dropdown4','','hide','closer','','show')"> <img src="graphics/buttons/button3.gif" alt="" name="button3" width="120" height="25" border="0" id="button3" title=""></a></td> <td><a href="apply.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','show','closer','','show')"> <img src="graphics/buttons/button4.gif" alt="" name="button4" width="120" height="25" border="0" id="button4" title=""></a></td> <td><a href="news.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button5.gif" alt="" name="button5" width="120" height="25" border="0" id="button5" title=""></a></td> <td><a href="contactus.html" onMouseOver="MM_showHideLayers('dropdown3','','hide','dropdown4','','hide')"> <img src="graphics/buttons/button6.gif" alt="" name="button6" width="120" height="25" border="0" id="button6" title=""></a></td> <td width="100%"> </td> </tr> </table></td> <!-- outer table image topright side --> </tr> <tr> <!-- outer table middle graphic --> <td valign="top"><!--begin slogan content area - lady and company slogan area--> <table border="0" cellpadding="0" cellspacing="0" id="slogansection"> <tr> <td><img src="graphics/midsection.jpg" alt="" width="750" height="212" border="0"></td> </tr> </table></td> <!-- outer table image rightside middle --> </tr> <tr valign="top"> <!-- end of mid slogan area --> <!-- start of main content area --> <td height="546"><table width="750" border="0" cellpadding="0" cellspacing="0" id="contenttable"> <tr> <td width="750" valign="top"><h1 align="center"> <p>You may submit additional materials you feel may be helpful to the LOI to:</p> <p align="center">The Leon Levine Foundation<br> ATTN: Grants Administration<br> 6000 Fairview Rd. Suite 1525<br> Charlotte, NC 28210</p> <p align="center"> </p> <p align="center"> </p> <ul> <p><br> <br> <br> <br> <br> <br> <br> <br> </p> <h1 align="center"> </h1> <p><br> <br> <br> </p> <META HTTP-EQUIV="Refresh" Content="5000; URL=index.html"> </td> </tr> </table> <span class="style2"> <!-- end of content area --> <!-- begin text link area --> </span> <table width="100%" border="0" cellpadding="0" cellspacing="0" id="linkbar"> <tr> <td align="center" class="style2"><p><a href="index.html">Home</a> |<a href="contactus.html"> Contact Us</a></p> <p>Leon Levine Foundation Copyright © 2009</p> <p> </p></td> </tr> </table></tr> </table> </body> </html> let me know how that works... the other option before trying this, is right after the code i told you to enter (which can be removed now), you have </SCRIPT> instead of ?> to close the php. this could be a solution to your issues as well.. try the easier one, then try the 3 file method (form, php, html success page)... Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075723 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 THANKS!! Well I think we are getting somewhere. It looks like it is working but I never receive the cc email?? when I go to the main email I can see that the other email as a cc but it never shows up? I even tried cc the main address to see if I received 2 emails but no go... Any ideas? Onec again Thanks so much!! Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075741 Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 check the spam folder. it may go there. Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075743 Share on other sites More sharing options...
logicsound Posted June 22, 2010 Author Share Posted June 22, 2010 nope, I have tried a couple different emails too. even ones that have no filtering. Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075747 Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 hmm let me do some research on the CC and if all else fails i'll write up an alternate letter.php for you. Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075760 Share on other sites More sharing options...
radar Posted June 22, 2010 Share Posted June 22, 2010 try this <?php $email = $_POST['EMAIL']; $mailto = '[email protected]'; $mailsubj = "LOI"; $mailhead .= "FROM: LOI\r\n"; $mailhead .= "CC: ".$email; $mailbody = "Values submitted from LOI:\n"; while (list($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($mailto, $mailsubj, $mailbody, $mailhead); header("LOCATION: letter.html"); ?> if that doesnt work try this: <?php $email = $_POST['EMAIL']; $mailto = '[email protected]'; $mailsubj = "LOI"; $headers = "From: LOI" . "\r\n" . "CC: ".$email; $mailhead .= "FROM: LOI\r\n"; $mailhead .= "CC: ".$email; $mailbody = "Values submitted from LOI:\n"; while (list($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($mailto, $mailsubj, $mailbody, $mailhead); header("LOCATION: letter.html"); ?> if that doesnt work try this <?php $email = $_POST['EMAIL']; $mailto = '[email protected]'; $mailsubj = "LOI"; $mailhead .= "FROM: LOI"; $mailbody = "Values submitted from LOI:\n"; while (list($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($mailto, $mailsubj, $mailbody, $mailhead); mail($email, $mailsubj, $mailbody, $mailhead); header("LOCATION: letter.html"); ?> Link to comment https://forums.phpfreaks.com/topic/205564-add-cc-option-to-php-form/#findComment-1075764 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.