<?
    $_id 
= isset($_GET['i']) ? intval($_GET['i']) : 0;
    
$_page = isset($_GET['p']) ? intval($_GET['p']) : 1;

    if (
$GLOBALS['auth']['id'])
    {
        
mysql_query("DELETE FROM gallery_images WHERE image_id = " sq($_id) . " AND user_id = '" $GLOBALS['auth']['id'] . "'");
    }

    
header('Location: ./?s=upload_image&p=' $_page);
    die;
?>