Openclaw + 飞书🔥免费数字暖男封神 | Openclaw+feishu🔥free digital warm guy is awesome!

Image
古有 “肉屏风” 替主人遮风挡雨,今有 Openclaw 替你无怨干活,你只负责可爱就好😘!Openclaw 直接连上飞书,远程操作丝滑无卡顿,不用守在电脑前,你躺床追剧、吃零食,它就能帮你完成远程点点点,每天至少节省 1-2 小时重复操作!更绝的是,它能免费创建最多 10 个 agent(代理),像一群贴心工具人恋人,一个管飞书审批,一个管数据统计,一个管日常打招呼,各司其职还记忆不串台,绝不会把 “老板好烦” 发到老板群,翻车不存在的!零代码、零基础,小白点击 3 步就能上手,不用花一分钱,却能让飞书看起来像你有整支外包团队,打工人的数字暖男,谁用谁香💥 In the old days “meat screens” shielded their masters; today Openclaw grinds for you so you can just be cute😘! It hooks into Feishu seamlessly for remote control, no need to stay in front of the computer — you can binge-watch and eat snacks in bed while it handles all the clicks remotely, saving you 1-2 hours of repetitive work every day! Even better, it can freely create up to 10 agents, like a group of thoughtful tool-boyfriends — one for Feishu approvals, one for data statistics, one for daily greetings. Each does its own job with no memory mess, so “boss is annoying” never ends up in the boss group, no more mistakes! Zero code, zero basics, beginners can get started in 3 clicks, totally free, but it m...

Php session

Php session

Introduce how to use session for checking login.
Session 1: code (database file, login.php, checklogin.php, sessionCSS.css, conn.php, index.php)
Session 2: concept thread
Session 3: explanation

Database
-------------------------------------------------------------------------------------------------------
create database `sessionShop`;

CREATE TABLE admin
(
    name varchar(64) NOT NULL default '',
    password varchar(64) NOT NULL default '',
    primary key(name)
);

-------------------------------------------------------------------------------------------------------

login.php
-------------------------------------------------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<html>
       <head>
              <title>login</title>
       <link href="sessionCSS.css" type="text/css" rel="stylesheet"/>
       </head>
       <body class="basicbody">
              <table class="tbStyle" cellpadding="0" cellspacing="0" align="center">
                     <tr class="trStyle">
                            <td>
                                   Administrator LogIn
                            </td>
                     </tr>
                     <tr class="trstyleBotm">
                            <td>
                                   <form action="checklogin.php" method="post">
                                          <div class="ContainerDiv">
                                                 <div class="Div90">
                                                        <div class="wordDiv100">
                                                               UserName:
                                                        </div>
                                                        <div class="inputDiv500">
                                                               <input type="text" maxlength="200" name="username" id="username" placeholder="name" autofocus/>
                                                        </div>
                                                 </div>
                                                 <div class="Div90">
                                                        <div class="wordDiv100">
                                                               Password:
                                                        </div>
                                                        <div class="inputDiv500">
                                                               <input type="password" maxlength="200" name="psw" id="password" placeholder="password"/>
                                                        </div>
                                                 </div>
                                                 <div class="Div90">
                                                        <button type="submit" name="Submit" value="submitIt" class="btnStyle">
                                                               Submit
                                                        </button>
                                                        <button type="reset" name="Reset" value="ResetIt" class="btnStyle">
                                                               Reset
                                                        </button>
                                                 </div>
                                          </div>
                                   </form>
                            </td>
                     </tr>
              </table>
       </body>
</html>

-------------------------------------------------------------------------------------------------------


checklogin.php
-------------------------------------------------------------------------------------------------------
<?php
       require_once 'conn.php';
       session_start();
       $sessionTBname = 'admin';
       $sUserName = $_POST['username'];
       $sPassword = $_POST['psw'];
       $_SESSION['adminName'] = $sUserName;
       $_SESSION['adminPsw'] = $sPassword;
       $execSQL = 'select * from '.$sessionTBname." where name = '".$sUserName."'";
       if ($result = mysql_query($execSQL))
       {
              echo "connect to Table.";
              if ($rs = mysql_fetch_object($result))
              {
                     echo "Record is right.";
                     if ($rs->name == $sUserName && $rs->password == $sPassword && $_SESSION['adminName'] != '' && $_SESSION['adminPsw'] != '')
                     {
                            header("location:index.php");
                     }
                     else
                     {
                            echo "<script>alert('Username, Password check error.');location:href='login.php'</script>";
                     }
              }
              else
              {
                     echo "<script>alert('Record check error.');location:href='login.php'</script>";
              }
             
       }
       else
       {
              echo "can't connect to Table".mysql_error();
              echo "<script>alert('Table connection error.');location:href='login.php';</script>";
       }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<html>
       <head>
              <title>checklogin</title>
       <link href="sessionCSS.css" type="text/css" rel="stylesheet"/>
       </head>
       <body class="basicbody">
             
       </body>
       <?php
              session_unset();
              unset($_SESSION['adminName']);
              unset($_SESSION['adminPsw']);
              mysql_close();
       ?>
</html>

sessionCSS.css
-------------------------------------------------------------------------------------------------------
table.tbStyle
{
       width: 600px;
       height: 400px;
       border: 0px;
       text-align: center;
}

tr.trStyle
{
       width: 600px;
       height: 130px;
       font-family:"Times New Roman", Times, serif;
       font-size:50px;
       font-weight: bolder;
       text-align:center;
       text-shadow: grey 2px 2px;
}

tr.trstyleBotm
{
       width: 600px; height: 270px;
}

div.ContainerDiv
{
       width: 600px; height: 270px;
       margin: 0 auto;
       padding: 0px;
}

div.Div90
{
       width: 600px; height: 90px;
       margin: 0 auto;
       padding: 0px;
}

div.wordDiv100
{
       width: 120px; height: 66px;
       margin: 10px auto;
       padding: 0px;
       float: left;
       text-align: center;
       font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif;
       font-size:16px;
       font-weight: bolder;
       line-height: 60px;
}

div.inputDiv500
{
       width: 476px; height: 66px;
       margin: 10px auto;
       padding: 0px;
       float: left;
}

input#username
{
       width: 320px; height: 30px;
       margin: 12px auto;
       text-align: left;
       border-radius: 6px;
       -moz-border-radius: 6px;
       -webkit-border-radius: 6px;
       box-shadow: 2px 2px 5px #666;
       -moz-box-shadow: 2px 2px 5px #666;
       -webkit-box-shadow: 2px 2px 5px #666;
       outline: 0px;
}

input#password
{
       width: 320px; height: 30px;
       margin: 12px auto;
       text-align: left;
       border-radius: 6px;
       -moz-border-radius: 6px;
       -webkit-border-radius: 6px;
       box-shadow: 2px 2px 5px #666;
       -moz-box-shadow: 2px 2px 5px #666;
       -webkit-box-shadow: 2px 2px 5px #666;
       outline: 0px;
}

button.btnStyle
{
       width: 60px; height: 30px;
       border-radius: 5px;
       border: 1px #cfdcec solid;
       overflow: hidden;
       box-shadow: 1px 1px 3px gray;
       background: #e2eaf3;
}

button.btnStyle:hover
{
       background: #30588e;
}

conn.php
-------------------------------------------------------------------------------------------------------
<?php
       $sessionUserName = 'root';
       $sessionPassword = '654321';
       $sessionDBname = 'sessionShop';
       $ConnSession = mysql_connect("localhost", $sessionUserName, $sessionPassword) or die("connect wrong --- ".mysql_error());
       mysql_select_db($sessionDBname);
?>

index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<html>
       <head>
              <title>index</title>
       <link href="sessionCSS.css" type="text/css" rel="stylesheet"/>
       </head>
       <body class="basicbody">
              <div class="wordDiv100">Hello World.</div>
       </body>
</html>

-------------------------------------------------------------------------------------------------------

the thread about this sample is do login page first, then input username and password. Send username and password to checklogin.php. If the username and password is fit, then jump to index.php.

EXPLANATION
conn.php
-------------------------------------------------------------------------------------------------------
<?php
       $sessionUserName = 'root';
       $sessionPassword = '654321';
       $sessionDBname = 'sessionShop';
       $ConnSession = mysql_connect("localhost", $sessionUserName, $sessionPassword) or die("connect wrong --- ".mysql_error());
       mysql_select_db($sessionDBname);
?>
-------------------------------------------------------------------------------------------------------
This file is about connecting to database.

login.php
-------------------------------------------------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<html>
       <head>
              <title>login</title>
       <link href="sessionCSS.css" type="text/css" rel="stylesheet"/>
       </head>
       <body class="basicbody">
              <table class="tbStyle" cellpadding="0" cellspacing="0" align="center">
                     <tr class="trStyle">
                            <td>
                                   Administrator LogIn
                            </td>
                     </tr>
                     <tr class="trstyleBotm">
                            <td>
//post form here
                                   <form action="checklogin.php" method="post">
                                          <div class="ContainerDiv">
                                                 <div class="Div90">
                                                        <div class="wordDiv100">
                                                               UserName:
                                                        </div>
//input username
                                                        <div class="inputDiv500">
                                                               <input type="text" maxlength="200" name="username" id="username" placeholder="name" autofocus/>
                                                        </div>
                                                 </div>
                                                 <div class="Div90">
                                                        <div class="wordDiv100">
                                                               Password:
                                                        </div>
//input password
                                                        <div class="inputDiv500">
                                                               <input type="password" maxlength="200" name="psw" id="password" placeholder="password"/>
                                                        </div>
                                                 </div>
                                                 <div class="Div90">
//submit button and reset button
                                                        <button type="submit" name="Submit" value="submitIt" class="btnStyle">
                                                               Submit
                                                        </button>
                                                        <button type="reset" name="Reset" value="ResetIt" class="btnStyle">
                                                               Reset
                                                        </button>
                                                 </div>
                                          </div>
                                   </form>
                            </td>
                     </tr>
              </table>
       </body>
</html>

-------------------------------------------------------------------------------------------------------

checklogin.php
-------------------------------------------------------------------------------------------------------
<?php
//connect to database
       require_once 'conn.php';
//start session
       session_start();
       $sessionTBname = 'admin';
//get username from the FORM in login.php
       $sUserName = $_POST['username'];
//get password from the FORM in login.php
       $sPassword = $_POST['psw'];
//assign username and password to current page session
       $_SESSION['adminName'] = $sUserName;
       $_SESSION['adminPsw'] = $sPassword;
//sql select the record according to the username posted.
       $execSQL = 'select * from '.$sessionTBname." where name = '".$sUserName."'";
//get the record
       if ($result = mysql_query($execSQL))
       {
              echo "connect to Table.";
//get the object of the record.
              if ($rs = mysql_fetch_object($result))
              {
                     echo "Record is right.";
//check username and password are correct and session is not null.
                     if ($rs->name == $sUserName && $rs->password == $sPassword && $_SESSION['adminName'] != '' && $_SESSION['adminPsw'] != '')
                     {
                            header("location:index.php");
                     }
                     else
                     {
                            echo "<script>alert('Username, Password check error.');location:href='login.php'</script>";
                     }
              }
              else
              {
                     echo "<script>alert('Record check error.');location:href='login.php'</script>";
              }
             
       }
       else
       {
              echo "can't connect to Table".mysql_error();
              echo "<script>alert('Table connection error.');location:href='login.php';</script>";
       }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<html>
       <head>
              <title>checklogin</title>
       <link href="sessionCSS.css" type="text/css" rel="stylesheet"/>
       </head>
       <body class="basicbody">
             
       </body>
       <?php
              session_unset();
              unset($_SESSION['adminName']);
              unset($_SESSION['adminPsw']);
              mysql_close();
       ?>
</html>


That is all.

Comments

爽文共赏/Popular Posts

【Xai, Be Nice】Grok's Secret Menu 6 Hacks to Master the AI | Grok隐藏玩法 6招驯服AI巨兽

5分钟拿下原生IP + 免费节点 手残变大佬 | From Noob to Pro in 5 Minutes: 10 Real IPs + Daily Fresh Free Nodes

免费节点无限续?OneBox+subs-check,付费党沉默了 | Free Nodes Never Die? OneBox + subs-check, Paid Users Left Speechless

一口气搭好!Cloudflare融合Railway与Galaxy打造纯净原生免费VPS | Build a Pure Free VPS with Cloudflare + Railway + Galaxy in One Go

Your Home’s Silent Guardian—DDNS Rocks Stability - 家里的“智能管家”!DDNS让你稳如泰山🏠✨

3 Steps to AI Video Fame✨WebSocket+Copilot Auto-Update, Newbies Win Too | 3 步 AI 视频封神✨WebSocket+Copilot 自动更,小白也能卷赢