You donot have a rite to approve users"; exit(); } //extracting user information $query = "SELECT * FROM users where username=\"$accountid\""; $result = sqlite3_query($handle, $query) or die("Error in query: ".sqlite3_error($handle)); if (($row = sqlite3_fetch_array($result)) == '') { echo "
Not a valid account id
"; exit(); } $name = $row["name"]; $email = $row["email"]; $website = $row["website"]; $desc = $row["description"]; if($row["approved"] == "true") { $query = "SELECT * FROM approval where approved=\"$accountid\""; $result = sqlite3_query($handle, $query) or die("Error in query: ".sqlite3_error($handle)); $row = sqlite3_fetch_array($result); echo "
Already $accountid is approved by ".$row["approvedby"]."...
"; exit(); } ?>

Approval

Full name:

Account id:

Email:

Description:

Web Site:

Admin rites (check this if you want this user to be admin)

Successfully approved $accountid..."; } //if approval is canceled else if (isset($_POST['cancel'])) { //delete user $handle = sqlite3_open($db) or die("Could not open database"); $query = "delete from users where username=\"$accountid\""; $result = sqlite3_exec($handle, $query) or die("Error in query: ".sqlite3_error($handle)); echo "
Successfully cancelled $accountid...
"; } function generate_passwd($length = 16) { static $chars = '!@#$%^&*abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ23456789'; $chars_len = strlen($chars); for ($i = 0; $i < $length; $i++) $password .= $chars[mt_rand(0, $chars_len - 1)]; return $password; } ?>