人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當前位置:蘿卜系統下載站 > 技術開發教程 > 詳細頁面

生成sessionid與隨機密碼的例子

生成sessionid與隨機密碼的例子

更新時間:2022-09-16 文章作者:未知 信息來源:網絡 閱讀次數:

用這個可以來驗證用戶和生成隨機密碼--teaman
<?
        //----------------------------------------------------
        // Function GetSID()
        //
        // Parameters : $nSize number of caracters, default 24
        // Return value : 24 caracters string
        //
        // Description : This function returns a random string
        // of 24 caracters that can be used to identify users
        // on your web site in a more secure way. You can also  
        // use this function to generate passwords.
        //----------------------------------------------------
        function GetSID ($nSize=24) {
             
            // Randomize
            mt_srand ((double) microtime() * 1000000);
            for ($i=1; $i<=$nSize; $i++) {
                 
                // if you wish to add numbers in your string,  
                // uncomment the two lines that are commented
                // in the if statement
                $nRandom = mt_rand(1,30);
                if ($nRandom <= 10) {
                    // Uppercase letters
                    $sessionID .= chr(mt_rand(65,90));
            //    } elseif ($nRandom <= 20) {
            //        $sessionID .= mt_rand(0,9);
                } else {
                    // Lowercase letters
                    $sessionID .= chr(mt_rand(97,122));
                }
                 
            }         
            return $sessionID;
        }
        // Test the function  
        echo GetSID(16);
    ?> 

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

網站地圖xml | 網站地圖html
主站蜘蛛池模板: 贵德县| 青神县| 临西县| 巴林右旗| 灵山县| 思南县| 武胜县| 房山区| 麦盖提县| 分宜县| 寻乌县| 福泉市| 江门市| 宿迁市| 玛曲县| 临沭县| 梅州市| 隆化县| 修武县| 绵阳市| 靖江市| 杭锦后旗| 临颍县| 金门县| 寿阳县| 苍梧县| 错那县| 开原市| 军事| 阳原县| 滨州市| 宣化县| 鲜城| 大姚县| 甘谷县| 府谷县| 镇雄县| 临桂县| 闻喜县| 宜昌市| 静安区|