The quotes within the quotes.
Change to:
echo"<META NAME=\"keywords\" CONTENT=\" $keywords \">";

> From: "Gary" <[EMAIL PROTECTED]>
> Sent: Saturday, September 28, 2002 11:15 AM
> Subject: [PHP] unexpected T_STRING error

> Hi All,
> Can someone explain to me why I am getting an error for the following?
> $keywords = $_POST[keywords];
> if ($keywords) {
>     echo"&lt;META NAME="keywords" CONTENT=" $keywords "&gt;";
> }

The quotes within the quotes -- you need to escape them.   Otherwise, the
second double quote terminates the quoted string, yet there's some more junk
on the line.  By escaping them, you tellphp you mean the literal ", and
don't want to terminate the string .
So change to:
echo"&lt;META NAME=\"keywords\" CONTENT=\" $keywords \"&gt;";

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to