首頁 index.php
成都創(chuàng)新互聯(lián)公司是一家專注于網(wǎng)站設(shè)計(jì)、成都網(wǎng)站設(shè)計(jì)與策劃設(shè)計(jì),潁東網(wǎng)站建設(shè)哪家好?成都創(chuàng)新互聯(lián)公司做網(wǎng)站,專注于網(wǎng)站建設(shè)10余年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:潁東等地區(qū)。潁東做網(wǎng)站價(jià)格咨詢:18980820575
退出"; if($_SESSION['allow_1'] ==1 ){ echo '你有1這個(gè)權(quán)限!
'; } if($_SESSION['allow_2'] ==1 ){ echo '你有2這個(gè)權(quán)限!
'; } if($_SESSION['allow_3'] ==1 ){ echo '你有2這個(gè)權(quán)限!
'; } $query = "select id,uid,title,ptime,mbody from email where uid=?"; $stmt = $pdo->prepare($query); $stmt->execute(array($_SESSION['id'])); $data = $stmt->fetchAll(PDO::FETCH_ASSOC); echo "你有".$stmt->rowCount()."封郵件
"; echo '
'.$value['id'].' | '; echo ''.$value['title'].' | '; echo ''.$value['ptime'].' | '; echo ''.$value['mbody'].' | '; echo '
登錄頁面login.php
prepare($query); $stmt ->execute(array($_POST['username'],$_POST['password'])); if($stmt->rowCount()>0){ //將用戶信息一次性放到session中 $_SESSION=$stmt->fetch(PDO::FETCH_ASSOC); //加登錄標(biāo)記 $_SESSION['islogin'] = 1; header("Location:index.php"); } } ?>PHP study 郵件登錄系統(tǒng)
數(shù)據(jù)庫連接配置文件conn.inc.php
getMessage(); exit; }
配置文件config.php
數(shù)據(jù)庫設(shè)計(jì) user表
create table user( id int(11) not null primary key auto_increment, username varchar(50) not null, password char(32) not null, email varchar(80) not null, allow_1 smallint(6) not null default 0, allow_2 smallint(6) not null default 0, allow_3 smallint(6) not null default 0 ); insert into user(username,password,email,allow_1,allow_2,allow_3) values('xiaowang1','1234','xiaowang@163.com',0,0,0); insert into user(username,password,email,allow_1,allow_2,allow_3) values('xiaowang2','1234','xiaowang@163.com',0,0,0); insert into user(username,password,email,allow_1,allow_2,allow_3) values('xiaowang3','1234','xiaowang@163.com',0,0,0); insert into user(username,password,email,allow_1,allow_2,allow_3) values('xiaowang4','1234','xiaowang@163.com',0,0,0); insert into user(username,password,email,allow_1,allow_2,allow_3) values('xiaowang5','1234','xiaowang@163.com',0,0,0); insert into user(username,password,email,allow_1,allow_2,allow_3) values('xiaowang6','1234','xiaowang@163.com',0,0,0);數(shù)據(jù)庫設(shè)計(jì) email表
create table email( id int not null auto_increment , uid int not null default 0, title varchar(80) not null default ' ', ptime int not null default 0, mbody text, primary key(id) ); insert into email(uid,title,ptime,mbody) values(1,'wo',1222333,'I am a boy'); insert into email(uid,title,ptime,mbody) values(1,'wos',1222333,'I am a boy'); insert into email(uid,title,ptime,mbody) values(1,'wo1',1222333,'I am a boy'); insert into email(uid,title,ptime,mbody) values(1,'wo2',1222333,'I am a boy'); insert into email(uid,title,ptime,mbody) values(2,'2wo',1222333,'I am a boy'); insert into email(uid,title,ptime,mbody) values(2,'2wos',1222333,'I am a boy'); insert into email(uid,title,ptime,mbody) values(2,'2wo1',1222333,'I am a boy'); insert into email(uid,title,ptime,mbody) values(2,'2wo2',1222333,'I am a boy'); insert into email(uid,title,ptime,mbody) values(3,'3wo',1222333,'I am a boy'); insert into email(uid,title,ptime,mbody) values(3,'3wos',1222333,'I am a boy'); insert into email(uid,title,ptime,mbody) values(3,'3wo1',1222333,'I am a boy'); insert into email(uid,title,ptime,mbody) values(3,'3wo2',1222333,'I am a boy');
新聞名稱:PHPSESSION應(yīng)用郵件系統(tǒng)實(shí)例高洛峰細(xì)說PHP
文章起源:http://weahome.cn/article/jsceji.html