<? Php header ('content-Type: text/html; charset = UTF-8 '); Function MakeCard () { Set_time_limit (0 ); // Process the buffer Ob_end_clean (); Ob_implicit_flush (true ); Echo str_pad ("", 256 ); If (intval ($ _ POST ['num']> 0) $ num = intval ($ _ POST ['num']); // quantity If (intval ($ _ POST ['point']> 0) $ point = intval ($ _ POST ['point']); // points If (intval ($ _ POST ['batch']> 0) $ batch = intval ($ _ POST ['batch']); // batch number If ($ _ POST ['ym']! = "") $ Ym = $ _ POST ['ym']; // date of release Else $ ym = date ('ymm '); If ($ num = 0) return; $ Num = $ num * 100; // number of cards, that is, the number of records Echo "<p> Start". date ("H: I: s ").""; For ($ I = 1; $ I <= $ num; $ I ++) { $ Sn = sprintf ("% 02 s % 06 s", $ batch, $ ym, $ I ); $ Seek = mt_rand (). mt_rand (). mt_rand (); // 12 digits $ Start = mt_rand (0, 20 ); $ Str = strtoupper (substr (md5 ($ seek), $ start, 12 )); $ Str = str_replace ("O", chr (mt_rand (65,78), $ str ); $ Str = str_replace ("0", chr (mt_rand (65,78), $ str ); $ Row = array ('sn '=> $ sn, 'Password' => $ str, 'created' => time (), 'point' => $ point ); // Re-Query // Add the data insertion code here. Print_r ($ row ); } Echo "end". date ("H: I: s ").""; Printf ("<br> successfully generated: % s passwords at % s </p>", $ num/1e4, $ point ); Return $ num; } // Function end $ _ POST ['num'] = 1; $ _ POST ['point'] = 10; $ _ POST ['batch'] = 10; $ _ POST ['ym'] = '000000 '; Echo MakeCard ();?> |