我正在尝试编写脚本来上传脚本以从我的服务器中删除图像。我不断收到错误消息。谁能发现这段代码有什么问题?
// Delete image
if(isset($_GET['deleteImg']) && !empty($_GET['deleteImg']) && $_GET['deleteImg'] == true)
{
// Get imagepath from database
$result = mysql_query("SELECT image FROM frankkluytmans WHERE id=$id");
$imageDeletePath = mysql_fetch_assoc($result);
// Delete image from server
if(unlink($imageDeletePath['image']))
{
// Continue if image has been reset in database
if(mysql_query("UPDATE frankkluytmans SET `image`='' WHERE id=$id")){
// once deleted, redirect back to the view page
header("Location: index.php");
}
}
else
{
?>
<script type="text/javascript">
window.alert('This image could not be deleted.';
</script>
<?
}
}