php die html会执行吗,die()的PHP问题

所以,我有这个代码:

} else {

$photograph_moderation = new PhotographModeration($this->photograph_id);

$photograph_moderation->purgePhotograph();

//eventually take to an error page

die('image is not big enough to upload');

}

当满足此条件时,purgePhotograph()函数会被正确调用,但脚本似乎永远不会消失。有没有理由为什么死不会在这里被称为? purgePhotograph()也没有脚本执行命令。

这是purge_photograph函数:

public function purgePhotograph() {

$db = Connect::connect();

$photograph_id = $db->real_escape_string($this->photograph_id);

$query = "SELECT * from photographs WHERE id='{$this->photograph_id}'";

$result = $db->query($query);

$photograph = $result->fetch_assoc();

if ($photograph['location'])

unlink($photograph['location']);

if ($photograph['thumbnail_location'])

unlink($photograph['thumbnail_location']);

if ($photograph['watermark_location'])

unlink($photograph['watermark_location']);

if ($photograph['xsmall_location'])

unlink($photograph['xsmall_location']);

if ($photograph['small_location'])

unlink($photograph['small_location']);

if ($photograph['medium_location'])

unlink($photograph['medium_location']);

if ($photograph['large_location'])

unlink($photograph['large_location']);

if ($photograph['xlarge_location'])

unlink($photograph['xlarge_location']);

if ($photograph['xxlarge_location'])

unlink($photograph['xxlarge_location']);

if ($photograph['xxxlarge_location'])

unlink($photograph['xxxlarge_location']);

$query = "DELETE from photographs WHERE id='{$this->photograph_id}'";

$result = $db->query($query);

$query = "DELETE from photograph_tags WHERE photograph_id='{$this->photograph_id}'";

$result = $db->query($query);

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值