Home > Database > Mysql Tutorial > 一个基于mysql的登陆验证程序

一个基于mysql的登陆验证程序

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:01:48
Original
1157 people have browsed it

? /****************************************************** file name: login.php3 Login Check 编码: PHP 4 作者: Kevin Lee webwing@21cn.com Database: MySQL。 Host: localhost Database : mydb Table structure for table 'user' -----------------


/******************************************************
file name: login.php3
Login Check
编码: PHP 4
作者: Kevin Lee
Database: MySQL。
Host: localhost Database : mydb
Table structure for table 'user'
--------------------------------------------------------
CREATE TABLE user (
id smallint(6) NOT NULL auto_increment,
user varchar(12) NOT NULL,
passwd varchar(12) NOT NULL,
name varchar(20),
email varchar(30),
level char(1),
status char(1),
UNIQUE id (id)
);
--------------------------------------------------------
*******************************************************/
?>


$db_id = mysql_pconnect("localhost", "root", "");
$sql="select id, user, passwd from user where user='".$name."' and passwd='".$pwd."'";
$result = mysql_db_query("mydb",$sql);
$row = mysql_fetch_array($result);
$id = $row[id] ;
if ($id!="") {
session_start();
session_register("yn");
$yn="yes"  ;
echo "

";
echo "你已经成功登陆。。。"."

";
echo "

"."窗口10秒钟后自动关闭"."
";
echo "";
}
else {
echo "帐号或密码错误!!!";
echo "

";
echo "

";
echo "back";
echo "
" ;
}
?>



系统登陆








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
Why does it still jump after returning false?
From 1970-01-01 08:00:00
0
0
0
Optimize table indexes in MySQL
From 1970-01-01 08:00:00
0
0
0
Why can't I install it?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template