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

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

 更新時(shí)間:2006年10月09日 00:00:00   作者:  
用這個(gè)可以來驗(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)論

安阳县| 平邑县| 湾仔区| 绵阳市| 嘉鱼县| 伊宁县| 阿拉善左旗| 乌拉特前旗| 长汀县| 茂名市| 旅游| 黄骅市| 封丘县| 新余市| 商水县| 永川市| 靖西县| 黄龙县| 富蕴县| 大悟县| 太康县| 巍山| 隆德县| 观塘区| 宜黄县| 哈尔滨市| 封丘县| 时尚| 容城县| 离岛区| 阜南县| 娄烦县| 济阳县| 南木林县| 花莲市| 梓潼县| 沧源| 孙吴县| 阿图什市| 丰县| 商洛市|