Code: Select all
<?php
$hostname = "mysql.mydomain.com";
$username = "myusername";
$password = "mypassword";
$dbName = "mydbname";
$table = "mytablename";
MYSQL_CONNECT($hostname, $username, $password) OR DIE( "Unable to connect
to database");
cond == False
while(!cond) {
srand((unsigned)time(NULL));
int a1 = rand() % 26 + 1;
srand((unsigned)time(NULL));
int a2 = rand() % 26 + 1;
srand((unsigned)time(NULL));
int a3 = rand() % 26 + 1;
srand((unsigned)time(NULL));
int n1 = rand() % 10;
srand((unsigned)time(NULL));
int n2 = rand() % 10;
srand((unsigned)time(NULL));
int n3 = rand() % 10;
srand((unsigned)time(NULL));
int n4 = rand() % 10;
srand((unsigned)time(NULL));
int n5 = rand() % 10;
srand((unsigned)time(NULL));
int n6 = rand() % 10;
srand((unsigned)time(NULL));
int n7 = rand() % 10;
srand((unsigned)time(NULL));
int n8 = rand() % 10;
$rndaccount = chr(a1+ 65) . chr(a2 + 65) . chr(a3 + 65) . n1 . n2 . n3 . n4. n5 . n6 . n7 . n8
if(mysql_num_rows(mysql_query("SELECT account_num FROM mytablename WHERE account_num = '$rndaccount'"))){
// do nothing
}
else
$finaccount = $rndaccount
cond = true
echo $finaccount
}
?>