<!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=gb2312" /><title>学生课题查询</title><style type="text/css"><!--.STYLE1 {font-size: 14px}--></style></head><body><?php//######################学生查询所选课题########################## include "config.php"; include "header.php";?> <?if($search){ if ($xuehao=="") { echo"<p align=\"center\"><font color=\"#FF0000\"><b><big>请填写您的学号!</big></b></font></p>"; echo "<meta http-equiv=\"refresh\" content=\"1;url=query.php\">"; exit; } $query="select * from $student_table where xuehao='$xuehao'"; mysql_query("set names 'gb2312'"); $result=mysql_query($query); $row=mysql_fetch_array($result); if($row==0) { echo"<p align=\"center\"><font color=\"#FF0000\"><b><big>你还没有注册,或者你的输入有误,请重新输入!</big></b></font></p>"; echo "<meta http-equiv=\"refresh\" content=\"2;url=query.php\">"; exit; } $query="select id as sm from $student_table where xuehao='$xuehao'"; mysql_query("set names 'gb2312'"); $result=mysql_query($query); $row=mysql_fetch_array($result); if($row[sm]==0) { echo"<p align=\"center\"><font color=\"#FF0000\"><b><big>你还没有选择课题,请去选题!</big></b></font></p>"; echo "<meta http-equiv=\"refresh\" content=\"2;url=keti_list.php\">"; exit; } ?><table width="700" border="0" cellspacing="1" cellpadding="0" bgcolor="#333333" align="center"> <tr> <td width="78" height="30" bgcolor="#FFFFFF"> <div align="center" class="text"> <p class="STYLE1">学生学号</p> </div> </td> <td width=97 height="30" bgcolor="#FFFFFF"> <div align="center" class="STYLE1">学生姓名</div> </td> <td width="329" height="30" bgcolor="#FFFFFF"> <div align="center" class="STYLE1"> 课题名称 </div> </td> <td width=106 height="30" bgcolor="#FFFFFF"> <div align="center" class="STYLE1">指导教师</div> </td> <td width=84 height="30" bgcolor="#FFFFFF"> <div align="center" class="STYLE1">职称</div> </td> </tr> <? $n=0; $query=mysql_query("select * from $jiaoshi_table,$student_table where $jiaoshi_table.id=$student_table.id and $student_table.xuehao='$xuehao'"); mysql_query("set names 'gb2312'"); while($row=mysql_fetch_array($query)){ if(($n%2)!='0'){ echo "<tr bgcolor=#FFFFff>";} else{ echo "<tr bgcolor=#E4E4E4>"; } echo" <td height='22' class='STYLE1'> <div align='center'>".$row['xuehao']."</div></td> <td height='22'> <div align='center' class='STYLE1'>".$row['name']."</div></td> <td height='22' class='STYLE1'> <div align='center'>".$row['subject']."</div></td> <td height='22' class='STYLE1'> <div align='center'>".$row['teacher']."</div></td> <td height='22' class='STYLE1'> <div align='center'>".$row['zhicheng']."</div></td> </tr> "; $n++; } ?></table> <p> </p><?php include "foot.php";?>
当我输入学号查询的时候,运行结果却是一堆乱七八糟的东西。。。
注:我的表名叫做teacher,student
回复讨论(解决方案)
你截的图看看
你截的图看看
你截的图看看
哇塞,版主亲自回复。偶表示好激动地说。
你没开启段标签
改成
你没开启段标签
改成
你没开启段标签
改成
你代码到91行之前都在执行,你就不能开全了吗
$n=0; $query=mysql_query("select * from $jiaoshi
这里还有一个,你没改成
你代码到91行之前都在执行,你就不能开全了吗
$n=0; $query=mysql_query("select * from $jiaoshi
这里还有一个,你没改成<!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=gb2312" /><title>学生课题查询</title><style type="text/css"><!--.STYLE1 {font-size: 14px}--></style></head><body><?php//######################学生查询所选课题########################## include "config.php"; include "header.php";?><?phpif($search){ if ($xuehao=="") { echo"<p align=\"center\"><font color=\"#FF0000\"><b><big>请填写您的学号!</big></b></font></p>"; echo "<meta http-equiv=\"refresh\" content=\"1;url=query.php\">"; exit; } $query="select * from $student_table where xuehao='$xuehao'"; mysql_query("set names GB2312"); $result=mysql_query($query); $row=mysql_fetch_array($result); if($row==0) { echo"<p align=\"center\"><font color=\"#FF0000\"><b><big>你还没有注册,或者你的输入有误,请重新输入!</big></b></font></p>"; echo "<meta http-equiv=\"refresh\" content=\"2;url=query.php\">"; exit; } $query="select id as sm from $student_table where xuehao='$xuehao'"; mysql_query("set names 'GB2312'"); $result=mysql_query($query); $row=mysql_fetch_array($result); if($row[sm]==0) { echo"<p align=\"center\"><font color=\"#FF0000\"><b><big>你还没有选择课题,请去选题!</big></b></font></p>"; echo "<meta http-equiv=\"refresh\" content=\"2;url=keti_list.php\">"; exit; } ?><table width="700" border="0" cellspacing="1" cellpadding="0" bgcolor="#333333" align="center"> <tr> <td width="78" height="30" bgcolor="#FFFFFF"> <div align="center" class="text"> <p class="STYLE1">学生学号</p> </div> </td> <td width=97 height="30" bgcolor="#FFFFFF"> <div align="center" class="STYLE1">学生姓名</div> </td> <td width="329" height="30" bgcolor="#FFFFFF"> <div align="center" class="STYLE1"> 课题名称 </div> </td> <td width=106 height="30" bgcolor="#FFFFFF"> <div align="center" class="STYLE1">指导教师</div> </td> <td width=84 height="30" bgcolor="#FFFFFF"> <div align="center" class="STYLE1">职称</div> </td> </tr> <?php $n=0; $query=mysql_query("select * from $jiaoshi_table,$student_table where $jiaoshi_table.id=$student_table.id and $student_table.xuehao='$xuehao'"); mysql_query("set names GB2312"); while($row=mysql_fetch_array($query)){ if(($n%2)!='0'){ echo "<tr bgcolor=#FFFFff>";} else{ echo "<tr bgcolor=#E4E4E4>"; } echo" <td height='22' class='STYLE1'> <div align='center'>".$row['xuehao']."</div></td> <td height='22'> <div align='center' class='STYLE1'>".$row['name']."</div></td> <td height='22' class='STYLE1'> <div align='center'>".$row['subject']."</div></td> <td height='22' class='STYLE1'> <div align='center'>".$row['teacher']."</div></td> <td height='22' class='STYLE1'> <div align='center'>".$row['zhicheng']."</div></td> </tr> "; $n++; } ?></table> <p> </p><?php include "foot.php";?>
if($search)
{
这个if没有关闭,即少了 } 号
if($search)
{
这个if没有关闭,即少了 } 号 好,我看看
if($search)
{
这个if没有关闭,即少了 } 号 是加在48行后吗?我加了以后就变成这样了
是加在48行后吗?
我不知道你的逻辑,你自己应该很清楚啊。
$search 和 $xuehao 你在哪定义的?
是加在48行后吗?
我不知道你的逻辑,你自己应该很清楚啊。
$search 和 $xuehao 你在哪定义的? 不太清楚啊,因为这个代码老师给的让做修改……
最后缺了个分号
}
include "foot.php";?>
最后缺了个分号
}
include "foot.php";?> 有分号啊
…… 楼主这错误看着太头晕,建议你用eclipse什么的去检查一下,丢的东西有点多啊
…… 楼主这错误看着太头晕,建议你用eclipse什么的去检查一下,丢的东西有点多啊 说我的最后一行是语法错误,unexpected 'EOF'这是什么意思?
最后缺了个分号
}
include "foot.php";?> 有分号啊
你上面贴的代码里没有
…… 楼主这错误看着太头晕,建议你用eclipse什么的去检查一下,丢的东西有点多啊 说我的最后一行是语法错误,unexpected 'EOF'这是什么意思?
你那少了一个括号的括回,仔细检查一下代码吧。

在PHP中,trait适用于需要方法复用但不适合使用继承的情况。1)trait允许在类中复用方法,避免多重继承复杂性。2)使用trait时需注意方法冲突,可通过insteadof和as关键字解决。3)应避免过度使用trait,保持其单一职责,以优化性能和提高代码可维护性。

依赖注入容器(DIC)是一种管理和提供对象依赖关系的工具,用于PHP项目中。DIC的主要好处包括:1.解耦,使组件独立,代码易维护和测试;2.灵活性,易替换或修改依赖关系;3.可测试性,方便注入mock对象进行单元测试。

SplFixedArray在PHP中是一种固定大小的数组,适用于需要高性能和低内存使用量的场景。1)它在创建时需指定大小,避免动态调整带来的开销。2)基于C语言数组,直接操作内存,访问速度快。3)适合大规模数据处理和内存敏感环境,但需谨慎使用,因其大小固定。

PHP通过$\_FILES变量处理文件上传,确保安全性的方法包括:1.检查上传错误,2.验证文件类型和大小,3.防止文件覆盖,4.移动文件到永久存储位置。

JavaScript中处理空值可以使用NullCoalescingOperator(??)和NullCoalescingAssignmentOperator(??=)。1.??返回第一个非null或非undefined的操作数。2.??=将变量赋值为右操作数的值,但前提是该变量为null或undefined。这些操作符简化了代码逻辑,提高了可读性和性能。

CSP重要因为它能防范XSS攻击和限制资源加载,提升网站安全性。1.CSP是HTTP响应头的一部分,通过严格策略限制恶意行为。2.基本用法是只允许从同源加载资源。3.高级用法可设置更细粒度的策略,如允许特定域名加载脚本和样式。4.使用Content-Security-Policy-Report-Only头部可调试和优化CSP策略。

HTTP请求方法包括GET、POST、PUT和DELETE,分别用于获取、提交、更新和删除资源。1.GET方法用于获取资源,适用于读取操作。2.POST方法用于提交数据,常用于创建新资源。3.PUT方法用于更新资源,适用于完整更新。4.DELETE方法用于删除资源,适用于删除操作。

HTTPS是一种在HTTP基础上增加安全层的协议,主要通过加密数据保护用户隐私和数据安全。其工作原理包括TLS握手、证书验证和加密通信。实现HTTPS时需注意证书管理、性能影响和混合内容问题。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

WebStorm Mac版
好用的JavaScript开发工具

禅工作室 13.0.1
功能强大的PHP集成开发环境

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中