<?
//----------------------------------------------------
// Function GetSID()
//
// Parameters : $nSize number of carac " /> 亚洲精品欧美综合四区,综合久久久久久久,欧美日本一区二区

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

生成sessionid和隨機密碼的例子

用這個可以來驗證用戶和生成隨機密碼--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技術生成sessionid和隨機密碼的例子,轉載需保留來源!

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

主站蜘蛛池模板: 友谊县| 华蓥市| 延庆县| 云龙县| 南通市| 班玛县| 樟树市| 二连浩特市| 沙坪坝区| 乐东| 池州市| 叶城县| 五家渠市| 浦城县| 巴彦淖尔市| 土默特左旗| 莫力| 丰县| 太白县| 盘山县| 高州市| 德庆县| 耒阳市| 鹤山市| 福州市| 体育| 涟水县| 商河县| 繁峙县| 调兵山市| 柞水县| 贵阳市| 大余县| 和硕县| 安远县| 涟源市| 古蔺县| 门源| 枝江市| 奈曼旗| 寿光市|