求高手帮小弟我看看代码

php中文网
发布: 2016-06-13 10:29:32
原创
1109人浏览过

求高手帮我看看代码
帮我看下代码吧,谢谢了。
就是一个简单的登陆文件Login.php,语法没有问题,不知道是否是逻辑有问题,很简单的逻辑啊。
每次运行的结果都是“欢迎使用医院挂号门诊系统!”。
这个文件的参数都是从一个简单的HTML文件用post方法传来的。

HTML code
<!--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/2089">
                            <img src="https://img.php.cn/upload/ai_manual/000/000/000/175679988020895.png" alt="MiniMax Agent">
                        </a>
                        <div class="aritcle_card_info">
                            <a href="/ai/2089">MiniMax Agent</a>
                            <p>MiniMax平台推出的Agent智能体助手</p>
                            <div class="">
                                <img src="/static/images/card_xiazai.png" alt="MiniMax Agent">
                                <span>839</span>
                            </div>
                        </div>
                        <a href="/ai/2089" class="aritcle_card_btn">
                            <span>查看详情</span>
                            <img src="/static/images/cardxiayige-3.png" alt="MiniMax Agent">
                        </a>
                    </div>
                ";        }    }?></body></html>
登录后复制


------解决方案--------------------
if ($count=1)
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号