国产探花免费观看_亚洲丰满少妇自慰呻吟_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);
    ?> 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 大丰市| 湘潭县| 岳普湖县| 青阳县| 樟树市| 舟曲县| 吉水县| 敖汉旗| 开封市| 厦门市| 顺义区| 大邑县| 云浮市| 石渠县| 黄骅市| 澜沧| 天全县| 许昌市| 新巴尔虎左旗| 香河县| 满洲里市| 浙江省| 香格里拉县| 贺兰县| 桃江县| 舟曲县| 天水市| 凤台县| 阿瓦提县| 合作市| 枣阳市| 扶绥县| 岳阳市| 始兴县| 廊坊市| 南平市| 洛川县| 视频| 保山市| 轮台县| 开江县|