<?
//----------------------------------------------------
// Function GetSID()
//
// Parameters : $nSize number of carac " /> 精品亚洲porn,jizz性欧美23,78色国产精品

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

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

用這個可以來驗證用戶和生成隨機(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);
    ?> 

php技術(shù)生成sessionid和隨機(jī)密碼的例子,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 洛扎县| 贵南县| 诸城市| 金塔县| 神木县| 祁连县| 庆云县| 张家港市| 团风县| 会昌县| 綦江县| 贵州省| 松溪县| 山东| 东乡族自治县| 宝鸡市| 乌拉特后旗| 清徐县| 兴宁市| 河曲县| 阿尔山市| 景德镇市| 岚皋县| 武隆县| 柘荣县| 太仓市| 故城县| 琼海市| 阜阳市| 梨树县| 海丰县| 嘉义市| 三明市| 色达县| 金门县| 永春县| 普兰店市| 泉州市| 进贤县| 汝阳县| 嘉黎县|