Home > Backend Development > PHP Tutorial > p2psearcher green installation version implements login verification based on pear auth

p2psearcher green installation version implements login verification based on pear auth

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 08:42:01
Original
1444 people have browsed it

建立一个名为yz.php的页面

复制代码 代码如下:


require_once('Auth.php');
function show_login_form () {
echo '


username:


password:



' ;
}
$opti//root:1@localhost/zs',
'table'=>'users',
'usernamecol'=>'user_name',
'passwordcol'=>'user_passwd',
'cryptType'=>'',
'db_fields'=>'*',
);
$auth=new Auth('DB',$options,'show_login_form');
?>




$auth->start();
if($auth->checkAuth()){
echo "ok";
echo "
";
echo "add";
}else {
echo "error";
}
//$auth->setSessionName($auth->getAuthData('user_name'));
?>



登录后的session传递的页面yzh.php

复制代码 代码如下:


function back(){
echo 'back';
}
require_once('Auth.php');
$auth=new Auth('DB',$option,'back');
$auth->start();
if($auth->checkAuth())
{
echo "this is a session page,welcome ";
echo "{$auth->getUserName()}";
}
?>

以上就介绍了p2psearcher绿色安装版 基于pear auth实现登录验证,包括了p2psearcher绿色安装版方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template