-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatagenerator.php
More file actions
26 lines (17 loc) · 637 Bytes
/
Copy pathdatagenerator.php
File metadata and controls
26 lines (17 loc) · 637 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
require_once 'includes/db.inc.php';
function randomKey($length = 6)
{
$str = "0123456789abcdefghijklmnopqrstuvwxyz";
return substr(str_shuffle($str), 0, $length);
}
for ($i = 0; $i < 50; $i++) {
$username = randomKey(5) . " " . randomKey(6);
$useremail = randomKey(2) . "@gmail.com";
$userid = randomKey(3);
$userpassword = password_hash("a", PASSWORD_DEFAULT);
$usertype = "user";
$query = "INSERT INTO users (username, useremail, userid, userpassword, usertype) VALUES ('$username','$useremail','$userid','$userpassword','$usertype')";
mysqli_query($conn, $query);
}
echo "complete";