| function Makecard () { Set_time_limit (0); Handling buffers Ob_end_clean (); Ob_implicit_flush (TRUE); echo Str_pad ("", 256); if (intval ($_post[' num ']>0)) $num =intval ($_post[' num ']); Number if (intval ($_post[' point ']>0)) $point =intval ($_post[' point '); Points if (Intval ($_post[' batch ']>0)) $batch =intval ($_post[' batch ']); Batch if (($_post[' ym ']!= ")) $ym =$_post[' ym ']; Issue date else $ym =date (' ym '); if ($num ==0) return; $num = $num *100; Number of cards, i.e. number of records echo " Start ". Date (" H:i:s ")." "; for ($i =1; $i <= $num; $i + +) { $SN =sprintf ("%02s%s%06s", $batch, $ym, $i); $seek =mt_rand (0,9999). Mt_rand (0,9999). Mt_rand (0,9999); 12 Guests $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); Duplicate checking Add the code to insert the data here. Print_r ($row); } echo "End". Date ("H:i:s"). ""; printf (" Successful build: Password for%s million%s points ", $num/1e4, $point); return $num; }//Function end $_post[' num ']=1; $_post[' point ']=10; $_post[' Batch ']=10; $_post[' ym ']= ' 1405 '; Echo Makecard ();?> |