Does anyone know of a code that when you enter a username and push a button it deletes that username from that table, im mysql. thanks!
Ok i have managed to get a code that deletes a user from a table but how can i get it so when you enter a username into a text box and press the button it deletes that user?
Here's the code that is working for me now
Ok i have managed to get a code that deletes a user from a table but how can i get it so when you enter a username into a text box and press the button it deletes that user?
Here's the code that is working for me now
Code:
<?
ob_start();
include("config.php"); // includes config
if($logged[username] && $logged[level] == 12 || $logged[level] == 12) //checks if admin
{
$id = $_GET['id']; // gets the username
mysql_query("DELETE FROM users WHERE username = 'Admin'"); //deletes it
echo "<meta http-equiv=\"Refresh\" content=\"0; URL=find.php\"/>This User Has Been Deleted!</b>"; // shows results
}
else
{
echo("Silly, You must be admin!"); // if not admin is shows that
}
?>
Last edited: