mysql|程序
/******************************************************
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 ;
}
?>