syntax error, unexpected $end

cqheshuang 2010-01-30 06:51:37
错误提示:Parse error: syntax error, unexpected $end in C:\wwwroot\user manger\conn.php on line 48

下面源码:
<?php
$conn=mysql_connect("localhost","root","root");
mysql_select_db('user_manager',$conn);
function islogin()
{
if(isset($_COOKIE["usernmae"]) and isset($_COOKIE["password"]))
{
$rs="select id from memebers where username='".$_COOKIE["username"]."' and password = '".$_COOKIE["password"]."'";
if($result=mysql_query($rs)<=0)
{
echo "<script>alert('please login');location.href='';</script>";
}
}
}
function info($content,$url)
{
print <<<EOT
<br />
<table cellpadding="5" cellspacing="0" align="center">
<tr>
<th height="20" align="center">message</th>
</tr>
<tr>
<td align="center">
<table cellpadding="3" cellspacing="1" align="center">
</td>
</tr>
<tr>
<td align="left">
<blockquote>
<br />
{$content}<br />

please:<a target="_self" href="{$url}">[ click into page ]</a>
<script>
function nav()
{
location.href = "{$url}";
}
//three second
settimeout("nav()",3000);
</script>
</blockquote>
</td></tr>
</table>
EOT;
exit();
}
?>----------------48行
...全文
135 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
rayhome1987 2010-01-30
  • 打赏
  • 举报
回复
补充:
EOT;要顶格。
骄傲青蛙 2010-01-30
  • 打赏
  • 举报
回复
print < < <EOT 和 EOT;的行要独立, 不能有空格
骄傲青蛙 2010-01-30
  • 打赏
  • 举报
回复
Parse error: syntax error, unexpected $end
--------------------

48行有语法错误, 楼主详细检查一下
klinghr 2010-01-30
  • 打赏
  • 举报
回复
结尾的 EOT; 这行错了,好象前面多加了空格

使用定界符要注意:

结尾的一行,一定要另起一行,并且改行除了定界符结尾标识之外不能有任何其他字符,前后都不能有,包括空格。如果在本行最前或者最后出现空格,制表符的话,你会收到一个这样的错误信息:

Parse error: parse error, unexpected $end in……,提示你语法错误;

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧