国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

生成sessionid和隨機密碼的例子

2019-11-18 21:30:10
字體:
來源:轉載
供稿:網友
用這個可以來驗證用戶和生成隨機密碼--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);
    ?> 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 麻栗坡县| 白河县| 耿马| 松溪县| 商水县| 商城县| 河南省| 珲春市| 丰原市| 南溪县| 崇仁县| 林州市| 电白县| 韩城市| 平南县| 红安县| 怀远县| 宜兴市| 边坝县| 沅江市| 临邑县| 乌海市| 雷波县| 阳城县| 沙洋县| 久治县| 二连浩特市| 观塘区| 德兴市| 德惠市| 阳曲县| 鹤庆县| 当阳市| 长寿区| 龙海市| 四平市| 晋江市| 唐山市| 永新县| 武穴市| 江达县|