Guest User

Untitled

a guest
Aug 9th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. <?
  2.  
  3. //Configuration For CMS
  4. $db['host']="localhost"; // Set HOSTNAME
  5. $db['name']="test"; // Set database name
  6. $db['user']="root"; // Set database user
  7. $db['pass']="19941994"; // Set database pass
  8. $connect=@mysql_connect($db['host'],$db['user'],$db['pass']);
  9. $DB=@mysql_select_db($db['name'],$connect);
  10. //Made In Syria
  11.  
  12. function gp($length,$password,$type)
  13. {
  14. if($type=='group' or $type=='user')
  15. $possible = "012346789";
  16. else
  17. $possible = "012346789abcdefghijklmnopqrstuvwxyz";
  18. $maxlength = strlen($possible);
  19. if ($length > $maxlength) {
  20. $length = $maxlength;
  21. }
  22.  
  23. $i = 0;
  24.  
  25. while ($i < $length) {
  26. $char = substr($possible, mt_rand(0, $maxlength-1), 1);
  27. if (!strstr($password, $char)) {
  28. $password .= $char;
  29.  
  30. $i++;
  31. }
  32. }
  33. return $password;
  34. }
  35. $query = @mysql_query("SELECT * FROM activate");
  36. $rows = @mysql_fetch_array($query);
  37. $group = $rows['orderss'] + 1;
  38.  
  39. echo "
  40. <center><table width=400 border=1>
  41. <form method=POST action=''>
  42. <tr>
  43. <td>Num : </td>
  44. <td><input type=text size=15 name='num'></td>
  45. <td>$group</td>
  46. <input type='hidden' value='".$group."' name='group'>
  47.  
  48. </tr>
  49. <tr>
  50. <td colspan=3><center><input value='Generate' type=submit name='generate'></center></td>
  51. </tr>
  52. </form>
  53. </table></center>
  54. ";
  55. if($_POST['generate']){
  56. for($i=0;$i<$_POST['num'];$i++){
  57. $username = gp(12,"EAV-","user");
  58. $password = gp(10,"","");
  59. $group = $_POST['group'];
  60.  
  61. $Iquery=@mysql_query("INSERT INTO `activate` (`activate_id` ,`name` ,`pass_code` ,`orderss`) VALUES ('','".$username."','".$password."','".$group."')");
  62.  
  63. if(!$Iquery)
  64. echo "Success !";
  65. echo "<META HTTP-EQUIV='refresh' CONTENT='0; URL=test.php'>";
  66. }
  67.  
  68. }
  69. ?>
Add Comment
Please, Sign In to add comment