成人精品一区二区三区中文字幕-成人精品一区二区三区-成人精品一级毛片-成人精品亚洲-日本在线视频一区二区-日本在线视频免费

導航首頁 ? 技術教程 ? php cookie用戶登錄的詳解及實例代碼
全站頭部文字 我要出現在這里
php cookie用戶登錄的詳解及實例代碼 710 2024-01-17   

php cookie用戶登錄的實現

HTML源碼:

<html>
 <head>
 <title>php cookie用戶登錄的實現</title>
 </head>
 <body>
 <form name="forml" method="POST" action="CookieBasedPasswordLogin.php">
  <table>
   <tr>
    <td colspan="2" >
     <div align="center"><b>Please Specify the Password</b></div>
    </td>
   </tr>
  <tr>>
   <td>
    <div align="right">Customer ID</div>
   </td>
   <td>
    <input type="text" name="username">
   </td>
  </tr>
  <tr>
   <td>
    <div align="right">Password</div>
   </td>
   <td>
    <input type="password" name="password">
   </td>
  </tr>
  <tr>
   <td colspan="2">
    <center>
     <input type="submit" name="Submit" value="Login">
    </center>
   </td>
  </tr>
  </table>
 </form>
 </body>
 </html>
 

php源碼:

<?php
  $now = getdate();
  $storetime= $now["weekday"] . " " . $now["month"] ." " . $now["year"] ;
  $storetime.=" Time : ";

  if ($now["hours"] < 10) {
   $storetime.= "0" . $now["hours"];
  } else {
   $storetime.= $now["hours"];
  }
 
  $storetime.= ":";
  if ($now["minutes"]<10) {
   $storetime.= "0" . $now["minutes"];
  } else {
   $storetime.= $now["minutes"];
  }
  
  $storetime.= ": ";
  if ($now["seconds"] <10) {
   $storetime.= "0" . $now["seconds"];
  } else {
   $storetime.= $now["seconds"];
  }
  if (isset($data)) {
    $counter=++$data[l];
    setcookie("data[0]",$storetime,time() + (60*60*24));
    setcookie("data[l]", $counter,time() + (60*60*24)); setcookie("data[2]",$username,time() + (60*60*24));
    echo "<b><center>Hi " . $data[2] . " ! !</center></b><br>n";
    echo "<b><center>Last Login Time :" .$data[0] . "</center></b><br>n";
    echo "<b><center>Current Date :" .$storetime. "</center></b><br>n";
    echo "<b><center>Page View Count :" . $data[l]. "</center></b><br>n";
    echo "<b><center>You have successfully logged in!</center></b>";
    echo ("<b><contor>You can access this area without entering a password for the next 24 hours!</center></b>");
  } else {
  if (isset($username) && isset($password)) {
   if ($password=="superpass") {
     $counter=0;
     setcookie("data[0]",$storetime,time() + (60*60*24));
     setcookie("data[l]",$counter,time() + (60*60*24));
     setcookie("data[2]",$username,time() + (60*60*24));
     $url="Location: cookieimp.php";
     header($url);
   }else{
     echo "<hl><center>INVALID PASSWORD!!!</center></hl>";
   }
  }
 }
 ?> 

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!



主站蜘蛛池模板: 45分钟见奶薄纱透明时装秀| 戴夫·巴蒂斯塔| 辘轳女人和井全26集| 三年片在线观看电影在线观看大全| 珠帘玉幕图片| 美丽的日子 电视剧| 林黛玉进贾府人物形象分析| 黄视频免费网站| 塞下曲景然伶儿| 我的孩子我的家三观尽毁| 《之后》电影| 出埃及记电影| 头像图片2024最新款女| 三年片观看免费完整版中文版| 琉璃演员表全部演员介绍| 被主人调教| 安德鲁·林肯| 刘德华表里不一| 《白蛇传说》| 看美女图片| 抖音网页抖音| 台湾电视台| 安吉拉·莫雷纳| 环球棋牌| 李赫洙| 大国崛起思维导图| 红海行动2虎鲸行动| 大决战免费观看| 老友记 第一季 1994 詹妮弗·安妮斯顿| 寡妇电影| 宋小莹| 西藏秘密演员表全部| 电影白上之黑| 蓝燕3d电影《极乐宝鉴》在线观看| 太原教育电视台| 明宰铉身高| 劫中劫| 爱四| 色戒在线观看完整版| 电影《kiskisan》在线观看| 听鬼故事长篇超吓人2000字|

!!!站長長期在線接?。。?/p>

網站、小程序:定制開發/二次開發/仿制開發等

各種疑難雜癥解決/定制接口/定制采集等

站長微信:lxwl520520

站長QQ:1737366103