首页 > php教程 > php手册 > 正文

php登录代码

php中文网
发布: 2016-06-13 09:57:54
原创
1389人浏览过

php登录代码 这是一款完整理的php登录代码实例哦,他从数据库到html以及php程序,整个过程都一步步写出来了,是一款非常不错的入门级登录php代码。

php教程登录代码
这是一款完整理的php登录代码实例哦,他从数据库教程到html以及php程序,整个过程都一步步写出来了,是一款非常不错的入门级登录php代码。
*/

session_start(); /* get post */    if (!function_exists("getpost")){function getpost(){if(count($_post)){foreach($_post as $key => $value){global ${$key};${$key}=$value;}}}} /* get get */    if (!function_exists("getget")){function getget(){if(count($_get)){foreach($_get as $key => $value){global ${$key};$$key=($value);}}}} /* sql escape string */ if (!function_exists("escapeit")){ function escapeit($text){   if (get_magic_quotes_gpc()) $text=strips教程lashes($text);  if (!is_numeric($text)) $text=mysql教程_real_escape_string($text);  return $text; }}   getpost(); //获取post过来的数据


//login

$rs = $db->query("select * from `backend_user` where binary `login` = '".escapeit($login)."' and binary `password` = '".md5($password)."'");

if (mysql_num_rows($rs) > 0) {
 $row = $db->fetch_array($rs);
 $_session["smartinfo_sysid"] = $row["user_id"];
 $_session["smartinfo_syslogin"] = $row["login"];
 $db->query("update `backend_user` set `last_logon` = '".date("y-m-d h:i:s")."' where `id` = '".$row["id"]."'");
 header("location: index2.php");
} else {
 header("location: index.php?status=fail");
}

//利用到的函数

?>
html代码

Js登陆注册表单设计代码
Js登陆注册表单设计代码

分享一款js左右晃动切换登陆注册表单设计代码,简洁利落的ui和滑动切换设计适用于任何网站的登陆注册。

Js登陆注册表单设计代码 16
查看详情 Js登陆注册表单设计代码

 
     
       
     
 
control panel

 
 
   
   
     
     
   
     
   
   
 
  
 
 
@@##@@

 
     
     
   
   
     
     
   
   
  
     
   
 
login id:
password:

数据库

--
-- 表的结构 `backend_user`
--

create table if not exists `backend_user` (
  `user_id` int(11) not null auto_increment,
  `group_id` int(11) not null default '0',
  `login` varchar(255) not null default '',
  `password` varchar(255) not null default '',
  `last_logon` datetime not null default '0000-00-00 00:00:00',
  primary key  (`user_id`)
) engine=myisam  default charset=utf8 auto_increment=2 ;

--
-- 导出表中的数据 `backend_user`
--

insert into `backend_user` (`user_id`, `group_id`, `login`, `password`, `last_logon`) values
(1, 0, 'admin', 'e10adc3949ba59abbe56e057f20f883e', '0000-00-00 00:00:00');

php登录代码
相关标签:
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号