|
|||
|
Hi there.
I am using the exact PHP script for two web sites, both hosted by the same company. The company in question claims the same script would not work because the troubled site's server uses PHP 5. Could someone please have a look at the script below and tell me where I'm going wrong. Or could someone please send me a PHP script for 'name, email and comments' that could be applied with an HTML confirmation notice. Thank you very much <?php /* subject and email variables */ $subject = 'Comments from website'; $to = 'gustav@stage.co.za'; /* Gathering Data Variables */ $nameField = $_POST['name']; $commentField = $_POST['comments']; $emailField = $_POST['email']; $body = <<<EOD <br><hr><br> Name: $name <br> Email: $email <br> Comments: $comments <br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; ini_set("sendmail_from", "gustav@gandor.tv"); $success = mail($to, $subject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <!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>Personal Concierge of St. Thomas</title> <link href="concierge.css" rel="stylesheet" type="text/css" /> <!--[if IE 5]> <style type="text/css"> /* place css box model fixes for IE 5* in this conditional comment */ #sidebar1 { width: 230px; } </style> <![endif]--> <!--[if IE]> <style type="text/css"> /* place css fixes for all versions of IE in this conditional comment */ #sidebar1 { padding-top: 30px; } #mainContent { zoom: 1; } /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */ </style> <![endif]--> <style type="text/css"> <!-- --> </style> <script src="SpryAssets/SpryEffects.js" type="text/javascript"></script> <script 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_showHideLayers() { //v9.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible' v=='hide')?'hidden':v; }obj.visibility=v; } } function MM_effectHighlight(targetElement, duration, startColor, endColor, restoreColor, toggle) { Spry.Effect.DoHighlight(targetElement, {duration: duration, from: startColor, to: endColor, restoreColor: restoreColor, toggle: toggle}); } function MM_effectGrowShrink(targetElement, duration, from, to, toggle, referHeight, growFromCenter) { Spry.Effect.DoGrow(targetElement, {duration: duration, from: from, to: to, toggle: toggle, referHeight: referHeight, growCenter: growFromCenter}); } //--> </script> </head> <body> <div id="container"> <div id="sidebar1"><br /> <a href="index.html" onmouseover="MM_effectHighlight(this, 100, '#003366', '#CCCCCC', '#003366', true)">home</a><br /> <a href="about.html" onmouseover="MM_effectHighlight(this, 100, '#003366', '#CCCCCC', '#003366', true)">about</a><br /> <a href="Ourservice.html" onmouseover="MM_effectHighlight(this, 100, '#003366', '#CCCCCC', '#003366', true)">our service</a><br /> <a href="stateSide.html" onmouseover="MM_effectHighlight(this, 100, '#003366', '#CCCCCC', '#003366', true)">state side</a><br /> <a href="gallery.html" onmouseover="MM_effectHighlight(this, 100, '#003366', '#CCCCCC', '#003366', true)">picture gallery</a><br /> <a href="contact.html" onmouseover="MM_effectHighlight(this, 100, '#003366', '#CCCCCC', '#003366', true)">contact us</a></div> <!-- end #sidebar1 --> <div id="mainContent"> <span class="heading_18"> >> thank you</span><br /> <div id="contact_confirmation"><br /> Thank you for making contact with Personal Concierge of St. Thomas.<br /> <br /> We are currently experiencing problems with receiving emails from the website, so please contact me on 340-690-3542 <br /> <br /> <br /> Yours sincerely<br /> D'Lynn</div> <br /> <br /> <div id="apSmallPicDlynn"><img src="images/contact_dlynn.jpg" alt="" width="150" height="99" onload="MM_effectGrowShrink(this, 200, '0%', '100%', false, false, true)" /></div> </div> <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --> </div> <div id="footer">website powered by <a href="http://www.gandor.tv">gandor.tv</a></div> </body> </html> EOD; echo "$theResults"; ?> |
| Sponsored Links |
|
|||
|
I see nothing in there that would be a problem in PHP5. What happens when
you try to use this script? Are you hosted on Windows or *nix? -- Murray --- ICQ 71997575 Adobe Community Expert (If you *MUST* email me, don't LAUGH when you do so!) ================== http://www.projectseven.com/go - DW FAQs, Tutorials & Resources http://www.dwfaq.com - DW FAQs, Tutorials & Resources ================== "Guperman" <webforumsuser@macromedia.com> wrote in message news:g5lj2b$e0k$1@forums.macromedia.com... > Hi there. > > I am using the exact PHP script for two web sites, both hosted by the same > company. The company in question claims the same script would not work > because > the troubled site's server uses PHP 5. > > Could someone please have a look at the script below and tell me where I'm > going wrong. > > Or could someone please send me a PHP script for 'name, email and > comments' > that could be applied with an HTML confirmation notice. > > Thank you very much > > <?php > > /* subject and email variables */ > > > $subject = 'Comments from website'; > $to = 'gustav@stage.co.za'; > > /* Gathering Data Variables */ > > > $nameField = $_POST['name']; > $commentField = $_POST['comments']; > $emailField = $_POST['email']; > > $body = <<<EOD > <br><hr><br> > > Name: $name <br> > Email: $email <br> > Comments: $comments <br> > > EOD; > > $headers = "From: $email\r\n"; > $headers .= "Content-type: text/html\r\n"; > ini_set("sendmail_from", "gustav@gandor.tv"); > $success = mail($to, $subject, $body, $headers); > > > > /* Results rendered as HTML */ > > $theResults = <<<EOD > > <!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>Personal Concierge of St. Thomas</title> > <link href="concierge.css" rel="stylesheet" type="text/css" /> > <!--[if IE 5]> > <style type="text/css"> > /* place css box model fixes for IE 5* in this conditional comment */ > #sidebar1 { width: 230px; } > </style> > <![endif]--> > <!--[if IE]> > <style type="text/css"> > /* place css fixes for all versions of IE in this conditional comment */ > #sidebar1 { padding-top: 30px; } > #mainContent { zoom: 1; } > /* the above proprietary zoom property gives IE the hasLayout it needs to > avoid several bugs */ > </style> > <![endif]--> > <style type="text/css"> > <!-- > --> > </style> > <script src="SpryAssets/SpryEffects.js" type="text/javascript"></script> > > <script 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_showHideLayers() { //v9.0 > var i,p,v,obj,args=MM_showHideLayers.arguments; > for (i=0; i<(args.length-2); i+=3) > with (document) if (getElementById && > ((obj=getElementById(args[i]))!=null)) > { v=args[i+2]; > if (obj.style) { obj=obj.style; > v=(v=='show')?'visible' v=='hide')?'hidden':v; }> obj.visibility=v; } > } > function MM_effectHighlight(targetElement, duration, startColor, endColor, > restoreColor, toggle) > { > Spry.Effect.DoHighlight(targetElement, {duration: duration, from: > startColor, > to: endColor, restoreColor: restoreColor, toggle: toggle}); > } > function MM_effectGrowShrink(targetElement, duration, from, to, toggle, > referHeight, growFromCenter) > { > Spry.Effect.DoGrow(targetElement, {duration: duration, from: from, to: > to, > toggle: toggle, referHeight: referHeight, growCenter: growFromCenter}); > } > //--> > </script> > > </head> > > <body> > > > > <div id="container"> > > <div id="sidebar1"><br /> > <a href="index.html" onmouseover="MM_effectHighlight(this, 100, > '#003366', > '#CCCCCC', '#003366', true)">home</a><br /> > <a href="about.html" onmouseover="MM_effectHighlight(this, 100, > '#003366', > '#CCCCCC', '#003366', true)">about</a><br /> > <a href="Ourservice.html" onmouseover="MM_effectHighlight(this, 100, > '#003366', '#CCCCCC', '#003366', true)">our service</a><br /> > <a href="stateSide.html" onmouseover="MM_effectHighlight(this, 100, > '#003366', '#CCCCCC', '#003366', true)">state side</a><br /> > <a href="gallery.html" onmouseover="MM_effectHighlight(this, 100, > '#003366', > '#CCCCCC', '#003366', true)">picture gallery</a><br /> > <a href="contact.html" onmouseover="MM_effectHighlight(this, 100, > '#003366', > '#CCCCCC', '#003366', true)">contact us</a></div> > > <!-- end #sidebar1 --> > <div id="mainContent"> <span class="heading_18"> >> thank > you</span><br /> > > <div id="contact_confirmation"><br /> > Thank you for making contact with Personal Concierge of St. Thomas.<br > /> > <br /> > We are currently experiencing problems with receiving emails from the > website, so please contact me on 340-690-3542 > <br /> > <br /> > <br /> > Yours sincerely<br /> > D'Lynn</div> > > <br /> > <br /> > > <div id="apSmallPicDlynn"><img src="images/contact_dlynn.jpg" alt="" > width="150" height="99" onload="MM_effectGrowShrink(this, 200, '0%', > '100%', > false, false, true)" /></div> > > > </div> > <!-- This clearing element should immediately follow the #mainContent div > in > order to force the #container div to contain all child floats --> > > </div> > > <div id="footer">website powered by <a > href="http://www.gandor.tv">gandor.tv</a></div> > > </body> > </html> > > EOD; > echo "$theResults"; > > ?> > |
|
|||
|
Thanks Murray
Fortunately the server had an option of Windows and Linux platforms. I asked them to move my site to the Windows platform, and my submission form worked. Now I'm doing a site for a client who's with a server with a Linux platform and I find myself with the same problem again. Below please find the php file I use. On testing I do receive the email but a very empty email. Much appreciated. <?php /* subject and email variables */ $emailSubject = 'Reservation Day Trip with Jimmy Felix'; $to = '2005@stage.co.za'; /* Gathering Data Variables */ $nameField = $_POST['name']; $peopleField = $_POST['people']; $timeField = $_POST['time9am10am']; $timeField2 = $_POST['time12am1pm']; $timeField2 = $_POST['check']; $body = "<<<EOD <br><hr><br> Name: $name <br> People: $people <br> Time: $time9am10am <br> Time2: $time12am1pm <br> TermsConditionsChecked: $check <br> EOD"; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; ini_set("sendmail_from", "2005@stage.co.za"); $success = mail($to, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <!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> <script src="SpryAssets/SpryEffects.js" type="text/javascript"></script> <script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script> <script 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_effectHighlight(targetElement, duration, startColor, endColor, restoreColor, toggle) { Spry.Effect.DoHighlight(targetElement, {duration: duration, from: startColor, to: endColor, restoreColor: restoreColor, toggle: toggle}); } function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); } //--> </script> <link href="style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style1 {font-family: Verdana, Arial, Helvetica, sans-serif} .style2 {font-size: 85%} --> </style> <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- --> </style> </head> <body> <div id="Container"> <div id="Header"> <div class="HeaderText"> <span class="dottedUnderline">st.thomas day trips</span> </div></div> <div id="MainContent"> <div id="menu"> <div class="menu"> <p><span onclick="MM_goToURL('parent','index.html');return document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#DDE2E0', '#ffffff', true)"> home ::</span></p> <p><span onclick="MM_goToURL('parent','about.html');return document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#dde2e0', '#ffffff', true)">about ::</span></p> <p><span onclick="MM_goToURL('parent','maps.html');return document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#dde2e0', '#ffffff', true)">maps ::</span></p> <p><span onclick="MM_goToURL('parent','gallery.html');retur n document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#dde2e0', '#ffffff', true)">gallery ::</span></p> <p><span onclick="MM_goToURL('parent','reservations.html'); return document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#dde2e0', '#ffffff', true)">reservations ::</span></p> </div> </div> <br /> <div id="Accordion1" class="Accordion" tabindex="0"> <div class="AccordionPanel"> <div class="AccordionPanelTab">:: CONFIRMATION</div> <div class="AccordionPanelContent"> <div id="MainContentP"> <h1 class="Headings">Thank you for your reservation!</h1> We appreciate your business <p>Your driver's name is <span class="emphasisRedBold">Jimmy Felix</span>.</p> <p>Don't forget your camera!</p> <p>Lastly, don't forget to tell a friend about this tour - and the free Rum Punch at the Rum Factory...</p> <p> </p> <p> </p> <p><br /> </p> </div> </div> </div> <div class="AccordionPanel"> <div class="AccordionPanelTab">:: REMEMBER</div> <div class="AccordionPanelContent"> <div id="MainContentP"> <h1 class="Headings">Don't feed the inguanas!</h1> <div class="floatLeft"> <img src="images/inguana.jpg" /> </div>Although we treat our inguanas like you treat your labradors, they are prehistoric creatures who don't digest man made food well.<br /><br /> Besides, we won't go about feeding your labradors. It's not cool! <br /><br /> But don't worry, where I take you there aren't many inguanas. <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> </div> </div> </div> </div> <div id="Footer">Powered by gandor.tv</div> <div id="Footer2"></div> </div> <script type="text/javascript"> <!-- var Accordion1 = new Spry.Widget.Accordion("Accordion1"); //--> </script> </body> </html> EOD; echo "$theResults"; ?> |
|
|||
|
On Thu, 24 Jul 2008 15:43:40 +0000 (UTC), "Guperman"
<webforumsuser@macromedia.com> wrote: > $body = "<<<EOD > <br><hr><br> > > Name: $name <br> > People: $people <br> > Time: $time9am10am <br> > Time2: $time12am1pm <br> > TermsConditionsChecked: $check <br> > > EOD"; The above is wrong. Try it like this: $body = <<<EOD <br><hr><br> Name: $name <br> People: $people <br> Time: $time9am10am <br> Time2: $time12am1pm <br> TermsConditionsChecked: $check <br> EOD; Gary |
|
|||
|
Thanks Gary
My original script was as you suggested. Then I got advised to add the quotation marks. I've changed it back to what it was but with no luck. Any advice would be much appreciated. Might it be because the contact form is within an Spry accordion? <?php /* subject and email variables */ $emailSubject = 'Reservation Day Trip with Jimmy Felix'; $to = 'gustav@stage.co.za'; /* Gathering Data Variables */ $nameField = $_POST['name']; $peopleField = $_POST['people']; $timeField = $_POST['time9am10am']; $timeField2 = $_POST['time12am1pm']; $timeField2 = $_POST['check']; $body = <<<EOD <br><hr><br> Name: $name <br> People: $people <br> Time: $time9am10am <br> Time2: $time12am1pm <br> TermsConditionsChecked: $check <br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; ini_set("sendmail_from", "gustav@stage.co.za"); $success = mail($to, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <!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> <script src="SpryAssets/SpryEffects.js" type="text/javascript"></script> <script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script> <script 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_effectHighlight(targetElement, duration, startColor, endColor, restoreColor, toggle) { Spry.Effect.DoHighlight(targetElement, {duration: duration, from: startColor, to: endColor, restoreColor: restoreColor, toggle: toggle}); } function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); } //--> </script> <link href="style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style1 {font-family: Verdana, Arial, Helvetica, sans-serif} .style2 {font-size: 85%} --> </style> <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- --> </style> </head> <body> <div id="Container"> <div id="Header"> <div class="HeaderText"> <span class="dottedUnderline">st.thomas day trips</span> </div></div> <div id="MainContent"> <div id="menu"> <div class="menu"> <p><span onclick="MM_goToURL('parent','index.html');return document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#DDE2E0', '#ffffff', true)"> home ::</span></p> <p><span onclick="MM_goToURL('parent','about.html');return document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#dde2e0', '#ffffff', true)">about ::</span></p> <p><span onclick="MM_goToURL('parent','maps.html');return document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#dde2e0', '#ffffff', true)">maps ::</span></p> <p><span onclick="MM_goToURL('parent','gallery.html');retur n document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#dde2e0', '#ffffff', true)">gallery ::</span></p> <p><span onclick="MM_goToURL('parent','reservations.html'); return document.MM_returnValue" onmouseover="MM_effectHighlight(this, 100, '#ffffff', '#dde2e0', '#ffffff', true)">reservations ::</span></p> </div> </div> <br /> <div id="Accordion1" class="Accordion" tabindex="0"> <div class="AccordionPanel"> <div class="AccordionPanelTab">:: CONFIRMATION</div> <div class="AccordionPanelContent"> <div id="MainContentP"> <h1 class="Headings">Thank you for your reservation!</h1> We appreciate your business <p>Your driver's name is <span class="emphasisRedBold">Jimmy Felix</span>.</p> <p>Don't forget your camera!</p> <p>Lastly, don't forget to tell a friend about this tour - and the free Rum Punch at the Rum Factory...</p> <p> </p> <p> </p> <p><br /> </p> </div> </div> </div> <div class="AccordionPanel"> <div class="AccordionPanelTab">:: REMEMBER</div> <div class="AccordionPanelContent"> <div id="MainContentP"> <h1 class="Headings">Don't feed the inguanas!</h1> <div class="floatLeft"> <img src="images/inguana.jpg" /> </div>Although we treat our inguanas like you treat your labradors, they are prehistoric creatures who don't digest man made food well.<br /><br /> Besides, we won't go about feeding your labradors. It's not cool! <br /><br /> But don't worry, where I take you there aren't many inguanas. <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> </div> </div> </div> </div> <div id="Footer">Powered by gandor.tv</div> <div id="Footer2"></div> </div> <script type="text/javascript"> <!-- var Accordion1 = new Spry.Widget.Accordion("Accordion1"); //--> </script> </body> </html> EOD; echo "$theResults"; ?> |
|
|||
|
On Fri, 25 Jul 2008 12:46:01 +0000 (UTC), "Guperman"
<webforumsuser@macromedia.com> wrote: > My original script was as you suggested. Then I got advised to add the >quotation marks. I've changed it back to what it was but with no luck. Any >advice would be much appreciated. Might it be because the contact form is >within an Spry accordion? What happens when you try it? Gary |
|
|||
|
Hi Gary
You asked me what happens if I send the form. When I send it I do receive an email, but with no content. Like this: From: <daytripv@host94.hostmonster.com> Date: Sun, 20 Jul 2008 16:32:57 -0600 To: <myemailaddress> Subject: (which is correct) Name: People: Time: Time2: TermsConditionsChecked: _________________ > My original script was as you suggested. Then I got advised to add the >quotation marks. I've changed it back to what it was but with no luck. Any >advice would be much appreciated. Might it be because the contact form is >within an Spry accordion? What happens when you try it? Gary |
|
|||
|
On Sat, 26 Jul 2008 16:32:08 +0000 (UTC), "Guperman"
<webforumsuser@macromedia.com> wrote: > You asked me what happens if I send the form. When I send it I do receive an >email, but with no content. Like this: First, double check that the form's method is set to post, not get. Then, for debugging purposes, Try this to see what the script is seeing. <?php print "<pre>\n"; print_r($_POST); exit("</pre>\n"); /* subject and email variables */ $emailSubject = 'Reservation Day Trip with Jimmy Felix'; $to = 'gustav@stage.co.za'; /* Gathering Data Variables */ Gary |
|
|||
|
Gary wrote:
>First, double check that the form's method is set to post, not get. >Then, for debugging purposes, Try this to see what the script is >seeing. <?php print "<pre>\n"; print_r($_POST); exit("</pre>\n"); Hi Gary. The following is what comes up when I click the submission button after I have inserted the above script: Array ( [name] => test [people] => 3 [arrival] => 5/3?08 [time] => between 12am-1pm [cruiseship] => Liliship [check] => Yes I\'ve read the terms and conditions [submit] => Submit ) |
|
|||
|
On Mon, 28 Jul 2008 17:10:37 +0000 (UTC), "Guperman"
<webforumsuser@macromedia.com> wrote: > Array > ( > [name] => test > [people] => 3 > [arrival] => 5/3?08 > [time] => between 12am-1pm > [cruiseship] => Liliship > [check] => Yes I\'ve read the terms and conditions > [submit] => Submit > ) Okay. Here is your code from the form processing: $nameField = $_POST['name']; $peopleField = $_POST['people']; $timeField = $_POST['time9am10am']; $timeField2 = $_POST['time12am1pm']; $timeField2 = $_POST['check']; $body = <<<EOD <br><hr><br> Name: $name <br> People: $people <br> Time: $time9am10am <br> Time2: $time12am1pm <br> TermsConditionsChecked: $check <br> EOD; First, note the elements you're trying to use from the $_POST array are: name, people, time2am10am, time12am1pm, and check. The actual form fields are: name, people, time, cruiseship, and check. Note also the variables you are assigning the form results to: $nameField, $peopleField, $timeField, $timeField2, and (curiously) $timeField2 again. The variables you're putting into the message are: $name, $people, $time8am10am, $time12am1pm and $check. Try it this way: $name = $_POST['name']; $people = $_POST['people']; $arrival = $_POST['arrival']; $time = $_POST['time9am10am']; $cruiseship = $_POST['cruiseship']; $check = $_POST['check']; $body = <<<EOD <br><hr><br> Name: $name <br> People: $people <br> Arrival: $arrival <br> Time: $time <br> Cruiseship: $cruiseship <br> TermsConditionsChecked: $check <br> EOD; Gary |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise