解析错误:语法错误,意外的T

我不断收到以下错误:

解析错误:语法错误,第70行/home/a4999406/public_html/willingLog.html中的意外T_SL

在下面的代码中(第一行是第70行):

        echo <<<END 
<form action = "willingLog.html" method="post"><pre>
    First       <input type="text" name="first" />
    Last        <input type="text" name="last" />
    Email       <input type="text" name="email" />
    Username    <input type="text" name="user_name" />
                <input type="submit" value="AD RECORD" />
</pre></form>
END;

heredoc似乎不起作用。 我试过其他的例子。

以下是文档类型标题。 那里有什么不对吗?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

看一下复制粘贴,看起来你在第一行的“END”后面有一个空格字符:

'echo <<<END '

尝试摆脱空间角色。 通过谷歌搜索找到的答案。 来源(现在链接已死):http://www.alexxoid.com/blog/dev/php-dev/php-parse-error-unexpected-t_sl.html


尝试:

echo <<<'END'
<form action = "willingLog.html" method="post"><pre>
    First       <input type="text" name="first" />
    Last        <input type="text" name="last" />
    Email       <input type="text" name="email" />
    Username    <input type="text" name="user_name" />
                <input type="submit" value="AD RECORD" />
</pre></form>
END;
链接地址: http://www.djcxy.com/p/11919.html

上一篇: Parse error: syntax error, unexpected T

下一篇: Parse error: syntax error, unexpected T