Created
January 13, 2010 19:01
-
-
Save narkeeso/276472 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case 'remove': | |
$clean = array( 'hash' => sqlite_escape_string(trim($_GET['hash'])) ); | |
$query = 'SELECT sig, art FROM winners WHERE hash = "' . $clean['hash'] . '"'; | |
$winner = array_shift($database->arrayQuery($query)); | |
if (!$winner) { | |
header( 'Location: ./admin.php' ); | |
die; | |
} | |
// remove files and directory | |
recursive_rmdir(FILE_PATH . '/' . $winner['title']); | |
$query = 'DELETE FROM winners WHERE hash = "' . $clean['hash'] . '"'; | |
$database->queryExec($query); | |
header( 'Location: ./admin.php' ); | |
die; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment