PHP : How to remove images in the directory of my website using PHP

标签 php html mysql

我有以下代码:

<?php

include "../../koneksi.php";

$module=$_GET['module'];
$act=$_GET['act'];
$Gfile_id=$_GET['file_id'];

if ($module=='galleryPhoto' AND $act=='delete'){
    $del=mysql_query("DELETE FROM gallery_photo WHERE file_id='$Gfile_id'");
    header("location:../?v=gallery_foto&info=Success");
}

?>

我可以删除数据库行,但不能删除目录中的图像。如何从目录中删除图像?

最佳答案

你可以使用 unlink() 函数

unlink()

关于PHP : How to remove images in the directory of my website using PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26836331/

相关文章:

html - 减少div的宽度在css中移动到左侧

mysql - 如何允许 mysql(mariadb) 从/tmp 读取文件 - Fedora 30

php - 在 PHP 上将多种类型的日期字符串格式化为相同的日期格式

php - Angular2 http.post 表单值到 php 服务器

php - 将数据库中的不同列存储到数组中。

javascript - 在 Javascript 中隐藏下拉菜单中的对象

javascript - 没有收到有关 AJAX 成功的警报

javascript - 动态地将 ng-repeat 添加到 HTML 元素中

PHP: session 检查用户

Python和Flask,在html页面上显示mysql数据库中的数据