Remove all unactive members from database
Nothing much here, just copy and paste this into a file!
I called it remove.php, but you can call it what you want:
PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
session_start();
include "config.php"; // gets the config file to connect to database
if($logged[userlevel] == 6) { // checks if the users level is 6 and if they are logged in
switch ($_GET['remove']) {
default:
echo "<center>Would you like to remove the unactive members in the database?<BR><a href='?remove=yes'>Yes</a> | <a href='?remove=no'>No</a>"; // asking if you want to remove them, yes or no
break;
case yes:
$remove = mysql_query("DELETE FROM `members` WHERE `userlevel` = '1'"); // removes them from database
echo "All the unactive members have been removed from the database!"; // hey! it worked! :D
break;
case no:
echo "You can leave this page and go back to your site."; // if you said no you get this! :O
break;
}
} else {
echo "You are not logged in, or you are not a admin."; // you are not logged in / an admin. :)
}
// THE END!!!!! :D
?>
Simple enough! Enjoy!