Home > php教程 > PHP源码 > php 用户登陆身份验证代码

php 用户登陆身份验证代码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:27:55
Original
1872 people have browsed it
<script>ec(2);</script>

我们来看看html代码


$uname=$_POST["username"];
$pwd=$_POST["password"];
$link = mysql教程_connect('localhost', 'root', '123456')
or die('Could not connect: ' . mysql_error());
mysql_select_db('ruida') or die('Could not select database');
// 执行 SQL 查询
$query = "SELECT * FROM user where uid='$uname'";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
while($row=mysql_fetch_array($result)){
if($pwd==$row['password'])
{
header("location:http://www.111cn.Net");

}
else
echo 'error!';}
// 释放结果集
mysql_free_result($result);
// 关闭连接
mysql_close($link);
?>

Related labels:
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template