Re: PHP form not working

From: Date: Fri, 29 Jul 2005 00:27:58 +0000
Subject: Re: PHP form not working
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-219567@lists.php.net to get a copy of this message
Pasting your page onto my server and commenting out your includes the following lines stand out: $email_err ="<span class="red">Please enter your email address!</span><br />"; $message_err = "<span class="red">Please enter a message!</span><br />"; You have quotes within quotes here. You should either escape the inner quotes or use single quotes to define your string. So this will work: $email_err ="<span class=\"red\">Please enter your email address!</span><br />"; $message_err = "<span class=\"red\">Please enter a message!</span><br />"; or this will work: $email_err ='<span class="red">Please enter your email address!</span><br />'; $message_err = '<span class="red">Please enter a message!</span><br />'; The latter is slightly more efficient, but you won't notice the difference. Incidentally, you should consider separating your presentation from your logic a little more, but that's a whole other issue. HTH Matt On Thu, 28 Jul 2005, Bruce Gilbert wrote:
Here is the entire code on the page. Now I am getting an error again...
SNIP
$email_err ="<span class="red">Please enter your email address!</span><br />"; $send= "no"; } //check value of $_POST['message'] if ($POST['message'] =="") { $message_err = "<span class="red">Please enter a message!</span><br />";
SNIP
</html> http://inspired-evolution.com/Contact_Form_test.php error is on line 52
-- getInstance() http://www.getinstance.com

« previous php.general (#219567) next »