求高手帮我看看代码
帮我看下代码吧,谢谢了。
就是一个简单的登陆文件Login.php,语法没有问题,不知道是否是逻辑有问题,很简单的逻辑啊。
每次运行的结果都是“欢迎使用医院挂号门诊系统!”。
这个文件的参数都是从一个简单的HTML文件用post方法传来的。
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtm11/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>医院门诊系统</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
$user = $_POST['user'];
$passwd = $_POST['password'];
if ((!isset($user)) || (!isset($passwd)))
{
?>
<p>请输入用户名或密码</p>
<form method="post" action="Login.php">
<table id="atable">
<tr>
<td>用户名:</td><td><input type="text" name="user" /></td>
</tr>
<tr>
<td>密码:</td><td><input type="password" name="password" /></td>
</tr>
</table>
<input type="submit" value="登陆" style="width:100px;height:20px" />
</form>
<?php
}
else
{
$mysql = mysqli_connect("127.0.0.1","clinicadmin","clinicadmin");
if (!$mysql)
{
echo"无法连接服务器,登陆失败。";
exit;
}
$selected=mysqli_select_db($mysql, "clinic");
if (!$selected)
{
echo"连接服务器失败,登陆无效。";
exit;
}
$query = "select count(*) from user where account='".$user."' and password='".$passwd."'";
$result = mysqli_query($mysql, $query);
if (!$result)
{
echo"无法登陆!";
exit;
}
$row=mysqli_fetch_row($result);
$count=$row[0];
if ($count=1)
{
echo"<h2>欢迎使用医院挂号门诊系统!</h2>";
}
else
{
echo"<p>用户名或密码错误!</p>
<div class="aritcle_card">
<a class="aritcle_card_img" href="/ai/735">
<img src="https://img.php.cn/upload/ai_manual/001/246/273/68b6cdbf48df2598.png" alt="代码小浣熊">
</a>
<div class="aritcle_card_info">
<a href="/ai/735">代码小浣熊</a>
<p>代码小浣熊是基于商汤大语言模型的软件智能研发助手,覆盖软件需求分析、架构设计、代码编写、软件测试等环节</p>
<div class="">
<img src="/static/images/card_xiazai.png" alt="代码小浣熊">
<span>51</span>
</div>
</div>
<a href="/ai/735" class="aritcle_card_btn">
<span>查看详情</span>
<img src="/static/images/cardxiayige-3.png" alt="代码小浣熊">
</a>
</div>
";
}
}
?>
</body>
</html>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号