相当粗略的
分类:热门新闻

php 文件安装程序三

提供一款能够保存客商登录的音信来做了,这里正是多个简短的php 登入并设置cookie代码哦,很简短的。

$title.='管理记录';$content.='ul class=clist';$page=(isset($_GET['page']) intval($_GET['page'])0)?intval($_GET['page']):1;$q_aop=sprintf('select a.*, b.name, b.photo from %s as a, %s as b where a.aid=b.id order by a.datetime desc', $dbprefix.'adminop', $dbprefix.'member');$a_aop=mysql_query($q_aop) or die('');$tr_aop=mysql_num_rows($a_aop);$tp_aop=ceil($tr_aop/$r_main['pagesize']);if($page$tp_aop $tp_aop0)$page=$tp_aop;$q_l_aop=sprintf('%s limit %d, %d', $q_aop, ($page-1)*$r_main['pagesize'], $r_main['pagesize']);$aop=mysql_query($q_l_aop) or die('');$r_aop=mysql_fetch_assoc($aop);if(mysql_num_rows($aop)0){do{if(isset($_GET['did']) $_GET['did']==$r_aop['id']){$dSQL=sprintf('delete from %s where id=%s', $dbprefix.'adminop', $r_aop['id']);$result=mysql_query($dSQL) or die('');$topinfo.='script type=text/JavaScriptlocation.href='?m=settingt=adminop';/script';}else{$content.='li class=l_lista href=?m=useramp;id='.$r['aid'].'img src='.($r_aop['photo']!=''?$r_aop['photo']:'images/dphoto.jpg').' alt='.$r_aop['name'].' class=photo width=55 height=55//adiv class=list_rdiv class=list_titlespan class=gmodimg src=images/o_2.gif alt=去除 onclick=if(confirm('确认要删除?'State of QatarState of Qatarlocation.href='?m=settingt=adminopdid='.$r_aop['id'].''; style=cursor: pointer;//span'.getalink($r_aop['aid'], $r_aop['name']).'nbsp;nbsp;span class=gdate'.getldate($r_aop['datetime']).'/span/divdiv class=list_c';if($r_aop['tid']==1){$pr=getpinfo($r_aop['sid']);$content.='a href=?m=albumamp;id='.$r_aop['sid'].'img src='.getthu($pr).' alt='.$pr['title'].' width=70 height=70 class=al_t//abr/';}elseif($r_aop[tid]==2){$pr=getcinfo($r_aop['sid']);$content.='a href=?m=campamp;id='.$r_aop['sid'].''.$pr['title'].'/abr/br/';}$content.=gbookencode($r_aop['content']).'/div/div/li';}}while($r_aop=mysql_fetch_assoc($aop));$content.='/ul';if($tp_aop1)$content.=getpage($page, $tp_aopState of Qatar;}else{$content.='lidiv class=title管理记录/divdiv class=lcontent未有记录/div/li/ul';}mysql_free_result($aop);mysql_free_result($a_aop);

if(!$c_log){
 $title.='登陆';
 if($_SERVER['REQUEST_METHOD']=='POST'){
  if(isset($_POST['username']) && trim($_POST['username'])!='' && isset($_POST['password']) && trim($_POST['password'])!=''){
   $username=trim($_POST['username']);
   $password=enc_p(trim($_POST['password']));
   $q_author=sprintf('select * from %s where username=%s and password=%s', $dbprefix.'member', SQLString($username, 'text'), SQLString($password, 'text'));
   $author=mysql_query($q_author) or die('');
   $r_author=mysql_fetch_assoc($author);
   if(mysql_num_rows($author)>0){
    if($r_author['status']==0 || $r_main['veri']>0){
     $uSQL=sprintf('update %s set visit=visit+1, visitdate=%s where id=%s', $dbprefix.'member', time(), $r_author['id']);
     $result=mysql_query($uSQL) or die('');
     session_unset();
     session_start();
     $_SESSION['palu_id']=$r_author['id'];
     if(isset($_POST['remember']) && $_POST['remember']=='1'){
      setcookie('palu_u', $username, time()+86400*30);
      setcookie('palu_p', $password, time()+86400*30);
     }else{
      setcookie('palu_u','',time());
      setcookie('palu_p','',time());
     }
    }else{
     $e=1;
    }
   }else{
    $e=2;
   }
   mysql_free_result($author);
  }
  if(isset($_GET['m']))$u[]='m='.$_GET['m'];
  if(isset($_GET['t']))$u[]='t='.$_GET['t'];
  if(isset($_GET['page']))$u[]='page='.$_GET['page'];
  if(isset($e))$u[]='e='.$e;
  $topinfo.='<script type="text/JavaScript">location.href=''.(isset($u)?'?'.join('&', $u):'./').'';</script>';
 }else{
  if(isset($_GET['e'])){
   if($_GET['e']==2){
    $msg='客商名/密码错误!';
   }elseif($_GET['e']==3){
    $msg='注册成功!请'.($r_main['veri']>0?'登录':'等待管理员考察'State of Qatar.'。';
   }else{
    $msg='您的帐号还向来不经过考察,请稍候再试。';
   }
  }
  $content.='<div class="tcontent">'.(isset($msg)?'<div class="msg_v">'.$msg.'</div>':''卡塔尔.'<div class="title">登入</div><div class="lcontent"><form method="post" action="" onsubmit="return chklog(卡塔尔;"><div class="formline"><label for="formname">客商名:</label><input name="username" id="formname" size="32" maxlength="20" /></div><div class="formline"><label for="formpw">密 码:</label><input name="password" id="formpw" size="32" maxlength="20" type="password" /></div><div class="formline"><label></label><input name="remember" value="1" type="checkbox" title="为了确认保障消息安全,请不要在网吧或许国有机房接收此项!假若现在要注销此选项,只需点击“退出登入”就能够。" />记住笔者</div><div class="formline"><input type="submit" value="登录" id="formsubmit" class="button" /> <input type="reset" value="撤除" class="button" /><br/>'.($r_main['openreg']==0?'<a href="?m=reg">参加本班</a> | ':''卡塔尔.'<a href="?m=lostpw">忘记密码</a></div></form></div></div>';
 }
}else{
 $topinfo.='<script type="text/JavaScript">location.href='./';</script>';
}
?>

本文由威尼斯在线注册平台发布于热门新闻,转载请注明出处:相当粗略的

上一篇:而不是真正的客户端 IP 地址 下一篇:没有了
猜你喜欢
热门排行
精彩图文