Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- define('IN_MYCMS', true);
- include "common.php";
- $template->open('page_users_code.html');
- $template->page_title=$lang_strings["title_pfx"];
- function gp($length,$password,$type)
- {
- // if($type=='group')
- if($type=='group' or $type=='user')
- $possible = "012346789";
- else
- $possible = "012346789abcdefghijklmnopqrstuvwxyz";
- $maxlength = strlen($possible);
- if ($length > $maxlength) {
- $length = $maxlength;
- }
- $i = 0;
- while ($i < $length) {
- $char = substr($possible, mt_rand(0, $maxlength-1), 1);
- if (!strstr($password, $char)) {
- $password .= $char;
- $i++;
- }
- }
- return $password;
- }
- //$group = gp(3,"","group");
- $query = @mysql_query("SELECT * FROM activate WHERE orderss='".$group."'");
- if(@mysql_num_rows($query) > 0){
- $rows = @mysql_fetch_array($query);
- $group = $rows['orderss'] + 1;
- }
- $to_replace['{CURRENT1}']= "
- <center><table width=400 border=1>
- <form method=POST action=''>
- <tr>
- <td>Num : </td>
- <td><input type=text size=15 name='num'></td>
- <td>$group</td>
- <input type='hidden' value='".$group."' name='group'>
- </tr>
- <tr>
- <td colspan=3><center><input value='Generate' type=submit name='generate'></center></td>
- </tr>
- </form>
- </table></center>
- ";
- if($_POST['generate']){
- for($i=0;$i<$_POST['num'];$i++){
- //$username = gp(12,"EAV-","");
- $username = gp(12,"EAV-","user");
- $password = gp(10,"","");
- $groub = $_POST['group'];
- //$groub = "123";
- $Iquery=$db->doQuery("INSERT INTO `activate` (`activate_id` ,`name` ,`pass_code` ,`orderss`) VALUES ('','".$username."','".$password."','".$groub."')");
- if(!$query)
- echo "Success !";
- }
- }
- $doTemplateOutput=true;
- include "includes/_toe.php";
- ?>
Add Comment
Please, Sign In to add comment