Reply to Re: [PHP] PHP form not working

Your name:

Reply:


Posted by Matt Zandstra on 11/14/78 11:23

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация