php代码老是提示:Parse error: syntax error, unexpected $end in D:\wamp\www\gpss2\stu.php on line 40
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<?
include("conn.php");
if($_SESSION['username']==""&&$_SESSION['password']==""){
echo"<script type='text/javascript'> alert('请先登录');location.href='/index.php';</script>";
$sql="select * from stu_info where username='".$_SESSION['username']."'";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query))
{
?>
<table width="400" height="300" align="center" >
<tr>
<td>姓名:<?=$row['username'];?></td><td>学号:<?=$row['num'];?></td>
</tr>
<tr>
<td>学院:<?=$row['college'];?></td><td></td>
</tr>
<tr>
<td>专业:<?=$row['career'];?></td><td>班级:<?=$row['banji'];?></td>
</tr>
<tr>
<td>已选毕业设计题?<?=$row['issue_name'];?></td><td></td>
</tr>
<tr>
<td>指导老师:<?=$row['issue_tch'];?></td>
</tr>
</table>
<?
}
?>
</body>
</html> 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<?
include("conn.php");
if($_SESSION['username']==""&&$_SESSION['password']==""){
echo"<script type='text/javascript'> alert('请先登录');location.href='/index.php';</script>";
$sql="select * from stu_info where username='".$_SESSION['username']."'";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query))
{
?>
<table width="400" height="300" align="center" >
<tr>
<td>姓名:<?=$row['username'];?></td><td>学号:<?=$row['num'];?></td>
</tr>
<tr>
<td>学院:<?=$row['college'];?></td><td></td>
</tr>
<tr>
<td>专业:<?=$row['career'];?></td><td>班级:<?=$row['banji'];?></td>
</tr>
<tr>
<td>已选毕业设计题?<?=$row['issue_name'];?></td><td></td>
</tr>
<tr>
<td>指导老师:<?=$row['issue_tch'];?></td>
</tr>
</table>
<?
}
?>
</body>
</html> 展开
4个回答
展开全部
好像是没有定义变量$end,你贴出的代码里没有$end这个变量,查看一下包含文件conn.php里是否有$end这个变量,看下赋值有没有问题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<?
include("conn.php");
if($_SESSION['username']==""&&$_SESSION['password']==""){
echo"<script type='text/javascript'> alert('请先登录');location.href='/index.php';</script>";
$sql="select * from stu_info where username='".$_SESSION['username']."'";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query))
{
?>
<table width="400" height="300" align="center" >
<tr>
<td>姓名:<?=$row['username'];?></td><td>学号:<?=$row['num'];?></td>
</tr>
<tr>
<td>学院:<?=$row['college'];?></td><td></td>
</tr>
<tr>
<td>专业:<?=$row['career'];?></td><td>班级:<?=$row['banji'];?></td>
</tr>
<tr>
<td>已选毕业设计题?<?=$row['issue_name'];?></td><td></td>
</tr>
<tr>
<td>指导老师:<?=$row['issue_tch'];?></td>
</tr>
</table>
<?
}
}
?>
</body>
</html>
后面少了一个}!
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<?
include("conn.php");
if($_SESSION['username']==""&&$_SESSION['password']==""){
echo"<script type='text/javascript'> alert('请先登录');location.href='/index.php';</script>";
$sql="select * from stu_info where username='".$_SESSION['username']."'";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query))
{
?>
<table width="400" height="300" align="center" >
<tr>
<td>姓名:<?=$row['username'];?></td><td>学号:<?=$row['num'];?></td>
</tr>
<tr>
<td>学院:<?=$row['college'];?></td><td></td>
</tr>
<tr>
<td>专业:<?=$row['career'];?></td><td>班级:<?=$row['banji'];?></td>
</tr>
<tr>
<td>已选毕业设计题?<?=$row['issue_name'];?></td><td></td>
</tr>
<tr>
<td>指导老师:<?=$row['issue_tch'];?></td>
</tr>
</table>
<?
}
}
?>
</body>
</html>
后面少了一个}!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
意思就是说,$end变量没定义好。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询