Home > php教程 > PHP源码 > php简单用户登陆程序代码

php简单用户登陆程序代码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:29:45
Original
1132 people have browsed it

php简单用户登陆程序代码

<script>ec(2);</script>

这些教程很对初学者来讲是很有用的哦,这款就下面这一点点代码了哦。


 

 


 

 


 

   
     
       
     
     
       
       
     
     
       
       
     
     
       
     
   
会员登陆界面 (login.php)|返回
用户:
密码:
  
         
   
         

 

 

 


 

登陆的php处理代码

include("config.php");
?>
if(empty($_POST["yd631_name"])){
echo ("");
}
if(empty($_POST["yd631_pws"])){
echo ("");
}
$yd631_name= $_POST["yd631_name"]; //用户名已经记录了
$yd631_pws= $_POST["yd631_pws"]; //密码已经记录了
$db=mysql_connect($servername,$sqlservername,$sqlserverpws);
mysql_select_db($sqlname,$db);
$sql="select * from $sqltable where yd631_name='$yd631_name' and yd631_pws='$yd631_pws'";
$result=mysql_fetch_array(mysql_query($sql));
if(!$result){
echo ("");
mysql_close();
exit;
}
if($result["yd631_pass"]=="no"){
 //验证会员是不是被审核通过了
echo ("");
}
session_start();
$_SESSION["name"]="$yd631_name";
echo "<script>location.href='yd631.php';</script>";
?>

config文件。

//常规参数设置

$servername="localhost";  //主机名
$sqlservername="root"; //mysql数据库用户名
$sqlserverpws="yd631"; //mysql数据库密码

$sqlname="yd631_user"; //数据库名
$sqltable="yd631_users"; //username表名


$admin_name="yd631";  //管理员用户名
$admin_pws="yd631";   //管理员密码
?>

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