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

WBOY
Release: 2016-06-02 11:27:54
Original
905 people have browsed it

界面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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!