Guest User

Untitled

a guest
Aug 9th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.55 KB | None | 0 0
  1.     <?
  2.     define('IN_MYCMS', true);
  3.      
  4.     include "common.php";
  5.      
  6.     $template->open('page_users_code.html');
  7.     $template->page_title=$lang_strings["title_pfx"];
  8.      
  9.      
  10.      
  11.      
  12.            
  13.                                    
  14.     function gp($length,$password,$type)
  15.             {
  16.     //      if($type=='group')
  17.             if($type=='group' or $type=='user')
  18.                     $possible = "012346789";
  19.             else
  20.                     $possible = "012346789abcdefghijklmnopqrstuvwxyz";
  21.                     $maxlength = strlen($possible);
  22.                     if ($length > $maxlength) {
  23.                         $length = $maxlength;
  24.                     }
  25.      
  26.                     $i = 0;
  27.      
  28.                     while ($i < $length) {
  29.                             $char = substr($possible, mt_rand(0, $maxlength-1), 1);
  30.                             if (!strstr($password, $char)) {
  31.                                     $password .= $char;
  32.                                    
  33.                                     $i++;
  34.                             }
  35.                     }
  36.                     return $password;
  37.             }
  38.             //$group = gp(3,"","group");
  39.             $query = @mysql_query("SELECT * FROM activate WHERE orderss='".$group."'");
  40.             if(@mysql_num_rows($query) > 0){
  41.                $rows = @mysql_fetch_array($query);
  42.            $group = $rows['orderss'] + 1;          
  43.            }
  44.                    
  45.                    
  46.                    
  47.                    
  48.                    
  49.                     $to_replace['{CURRENT1}']= "
  50.            <center><table width=400 border=1>
  51.            <form method=POST action=''>
  52.                    <tr>
  53.                            <td>Num : </td>
  54.                            <td><input type=text size=15 name='num'></td>
  55.                            <td>$group</td>
  56.                            <input type='hidden' value='".$group."' name='group'>
  57.                          
  58.                    </tr>
  59.                    <tr>
  60.                            <td colspan=3><center><input value='Generate' type=submit name='generate'></center></td>
  61.                    </tr>
  62.                            </form>
  63.                            </table></center>
  64.                    ";
  65.                    
  66.                    
  67.                    
  68.                     if($_POST['generate']){
  69.                             for($i=0;$i<$_POST['num'];$i++){
  70.                                     //$username = gp(12,"EAV-","");
  71.                                     $username = gp(12,"EAV-","user");
  72.                                     $password = gp(10,"","");
  73.                                     $groub = $_POST['group'];
  74.                                     //$groub = "123";
  75.                                    
  76.                                    
  77.     $Iquery=$db->doQuery("INSERT INTO `activate` (`activate_id` ,`name` ,`pass_code` ,`orderss`) VALUES ('','".$username."','".$password."','".$groub."')");
  78.      
  79.      
  80.      
  81.                                     if(!$query)
  82.                                             echo "Success !";
  83.                             }
  84.                            
  85.                     }
  86.                    
  87.                    
  88.                    
  89.                    
  90.                    
  91.                    
  92.                    
  93.                    
  94.                    
  95.                    
  96.                            
  97.                     $doTemplateOutput=true;
  98.     include "includes/_toe.php";  
  99.                    
  100.                    
  101.             ?>
Add Comment
Please, Sign In to add comment