Php Form Processing Problem

liunx

Guest
I just moved my client's site to TCH because the other host started running PHP in safe mode and I was unable to use a PHP script for form-to-email processing that I have used for over a year. However it looks like I'm having a similar issue with TCH. When I submit the form I receive the following error:<br /><br />Method Not Allowed<br />The requested method POST is not allowed for the URL /quote.html.<br /><br />--------------------------------------------------------------------------------<br /><br />Apache/1.3.33 Server at <!-- w --><a class="postlink" href="http://www.modernpropackaging.com">www.modernpropackaging.com</a><!-- w --> Port 80 <br /><br />Any suggestions?<!--content-->
You have nothing set for action="". This causes the form to try to POST to itself. Try setting the action to point to QouteRequest.php<!--content-->
<!--QuoteBegin-TCH-Dick+Jan 12 2005, 01:28 PM--><div class='quotetop'>QUOTE(TCH-Dick @ Jan 12 2005, 01:28 PM)</div><div class='quotemain'><!--QuoteEBegin-->You have nothing set for action="". This causes the form to try to POST to itself. Try setting the action to point to QouteRequest.php<br /><div align="right"><a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=107614"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />Thanks Dick. I added the Action line but then it was asking for a username and password so I moved the scripts out of the _private folder but now I'm getting this error:<br /><br />Parse error: parse error, unexpected $ in /home/modernp/public_html/scripts/QuoteRequest.php on line 45<br /><br />Help!!!!!<!--content-->
Can you post the script here?<!--content-->
<!--QuoteBegin-TCH-Dick+Jan 12 2005, 01:40 PM--><div class='quotetop'>QUOTE(TCH-Dick @ Jan 12 2005, 01:40 PM)</div><div class='quotemain'><!--QuoteEBegin-->Can you post the script here?<br /><div align="right"><a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=107617"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />Thanks for getting back to me on this so quickly!<br /><br />Here it is:<br /><br /><?php <br />$mailheaders = "From: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->\n"; <br />$mailheaders .= "Reply-To: $Email\n"; <br /><br />$message = "QUOTE REQUESTOR INFORMATION\n";<br />$message .= "First Name:\n";<br />$message .= "$_POST[FirstName]\n";<br />$message .= "Last Name:\n";<br />$message .= "$_POST[LastName]\n";<br />$message .= "Company:\n";<br />$message .= "$_POST[Company]\n";<br />$message .= "Address:\n";<br />$message .= "$_POST[Address1]\n";<br />$message .= "Address:\n";<br />$message .= "$_POST[Address2]\n";<br />$message .= "City:\n";<br />$message .= "$_POST[City]\n";<br />$message .= "State:\n";<br />$message .= "$_POST[State]\n";<br />$message .= "Zip:\n";<br />$message .= "$_POST[Zip]\n";<br />$message .= "Phone:\n";<br />$message .= "$_POST[Phone]\n";<br />$message .= "Fax:\n";<br />$message .= "$_POST[Fax]\n";<br />$message .= "EMail Address:\n";<br />$message .= "$_POST\n\n";<br />$message .= "Website Address:\n";<br />$message .= "$_POST[Website]\n\n";<br />$message .= "Please describe your packaging project or product needs:\n";<br />$message .= "$_POST[Project]\n";<br />$message .= "Other request or additional comments:\n";<br />$message .= "$_POST[Comments]\n\n";<br />$message .= "Return requested information via:\n";<br />$message .= "$_POST[ResultsBy]\n\n";<br /><br />$subject = "Quote Request";<br /><br />mail("[email protected]", $subject, $message, $mailheaders);<br /><br />echo "<Hi align=center>Thank You. $_POST[FirstName]</H1>";<br />echo "<P align=center>We will get back to you as soon as possible with the requested information.</p>;<br />?><!--content-->
The only errors I see is<br /><br /><!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->echo "<H<!--sizeo:7--><span style="font-size:36pt;line-height:100%"><!--/sizeo--><!--coloro:red--><span style="color:red"><!--/coloro-->i<!--sizec--></span><!--/sizec--><!--colorc--></span><!--/colorc--> align=center>Thank You. $_POST[FirstName]</H1>";<br />echo "<P align=center>We will get back to you as soon as possible with the requested information.</p><!--sizeo:7--><span style="font-size:36pt;line-height:100%"><!--/sizeo--><!--coloro:red--><span style="color:red"><!--/coloro-->;<!--sizec--></span><!--/sizec--><!--colorc--></span><!--/colorc--><!--QuoteEnd--></div><!--QuoteEEnd--><br />should be<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->echo "<H1 align=center>Thank You. $_POST[FirstName]</H1>";<br />echo "<P align=center>We will get back to you as soon as possible with the requested information.</p>";<!--c2--></div><!--ec2--><!--content-->
The error is on line 45 yet I see only 43. Is that normal?<!--content-->
<!--QuoteBegin-TCH-Dick+Jan 12 2005, 01:58 PM--><div class='quotetop'>QUOTE(TCH-Dick @ Jan 12 2005, 01:58 PM)</div><div class='quotemain'><!--QuoteEBegin-->The only errors I see is<br /><br /><!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->echo "<H<!--sizeo:7--><span style="font-size:36pt;line-height:100%"><!--/sizeo--><!--coloro:red--><span style="color:red"><!--/coloro-->i<!--sizec--></span><!--/sizec--><!--colorc--></span><!--/colorc--> align=center>Thank You. $_POST[FirstName]</H1>";<br />echo "<P align=center>We will get back to you as soon as possible with the requested information.</p><!--sizeo:7--><span style="font-size:36pt;line-height:100%"><!--/sizeo--><!--coloro:red--><span style="color:red"><!--/coloro-->;<!--sizec--></span><!--/sizec--><!--colorc--></span><!--/colorc--><!--QuoteEnd--></div><!--QuoteEEnd--><br />should be<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->echo "<H1 align=center>Thank You. $_POST[FirstName]</H1>";<br />echo "<P align=center>We will get back to you as soon as possible with the requested information.</p>";<!--c2--></div><!--ec2--><br /><div align="right"><a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=107622"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><br /><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />All better now. That was a totally lame mistake I made! Thanks Dick, I really appreciate your help!!!<!--content-->
No problem and let us know if you need anything else.<!--content-->
<!--QuoteBegin-TCH-Rob+Jan 12 2005, 04:14 PM--><div class='quotetop'>QUOTE(TCH-Rob @ Jan 12 2005, 04:14 PM)</div><div class='quotemain'><!--QuoteEBegin-->The error is on line 45 yet I see only 43.  Is that normal?<br /><div align="right"><a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=107625"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><!--QuoteEnd--></div><!--QuoteEEnd--><br />That was caused by that echo statement not being closed properly and there are probally spaces at the end of the script, so the error was spit out for what php thought was the end of that line. (OR something like that , Am I making any sense here?)<!--content-->
I understood<!--content-->
 
Back
Top