Skip to content

Instantly share code, notes, and snippets.

@narkeeso
Created January 13, 2010 19:01
Show Gist options
  • Save narkeeso/276472 to your computer and use it in GitHub Desktop.
Save narkeeso/276472 to your computer and use it in GitHub Desktop.
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