最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

生成sessionid和隨機(jī)密碼的例子

 更新時(shí)間:2006年10月09日 00:00:00   作者:  
用這個(gè)可以來(lái)驗(yàn)證用戶和生成隨機(jī)密碼--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);
    ?> 

相關(guān)文章

最新評(píng)論

合山市| 老河口市| 洱源县| 大安市| 荆州市| 德州市| 丽江市| 新乡县| 吉首市| 芒康县| 兰溪市| 勐海县| 东乌珠穆沁旗| 沂南县| 太仓市| 米脂县| 漯河市| 织金县| 河津市| 勐海县| 璧山县| 武穴市| 阿城市| 新化县| 晋城| 嘉峪关市| 大化| 大足县| 崇明县| 清镇市| 高阳县| 北宁市| 法库县| 耒阳市| 青龙| 依兰县| 贵溪市| 宜兰县| 蛟河市| 秦皇岛市| 旬阳县|