Home  >  Article  >  Backend Development  >  我的php登录界面总是显示我账号密码错误。。。我找不出错误 恳求各位大神帮助

我的php登录界面总是显示我账号密码错误。。。我找不出错误 恳求各位大神帮助

WBOY
WBOYOriginal
2016-06-02 11:27:54905browse

界面php

<code> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<h1>Welcome</h1>
<?phpif (!$_POST["user"]){    echo"<center>";?><table border="1"><form action="login.php" method="post">
<tr><td colspan="2" align="center">用户登录</td></tr>
<tr>
<td>输入用户名:</td>
<td><input type="text" name="user"></td>
</tr>
<tr>
<td>输入密码:</td>
<td><input type="password" name="pass"></td>
</tr>
<tr><td colspan="2" align="center"><input type="submit" value="登录"></td></tr>
</form></table>
<?php }else{    include"config.php";    $user=$_POST["user"];    $user=$_POST["pass"];    $sql="SELECT COUNT(id) FROM $db_examsystem_user WHERE name='$user' AND pass='$pass'";    $result=mysql_query($sql,$my_con);    $num=mysql_fetch_row($result);    if($num[0]==0)    {        echo"用户名或者密码错误,请检查!<p>";        echo"单击<a href="login.php">这里</a>重新登录<br>";        echo"单击<a href="regist.php">这里</a>进行注册";    }    else    {        setcookie("user",$user);        echo"登陆成功<p>";        echo"单机<a href="index.php">这里</a>进入系统";    }}?></p></code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn