Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/10/2015, 18:34
vito30
 
Fecha de Ingreso: octubre-2015
Ubicación: Antofagasta
Mensajes: 13
Antigüedad: 8 años, 7 meses
Puntos: 0
como eliminar una imagen del directorio

Hola Amigos,

Soy nuevo en el foro y en el tema de programación, es por eso que acudi a uds. para ver si me pueden ayudar con un problemita q tengo.

tengo una una base de datos donde subo imagenes y tambien las puedo editar y eliminar, pero cuando las eliminno solo se borran de la base de datos pero en el directorio aun figuran y no se como como lo puedo hacer para eliminarla de los dos sitios.

PS: estoy trabajando con Dreamweaver y este es el codigo PHP para eliminar que tengo.

<?php require_once('Connections/conexionnorthcontrols.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

if ((isset($_GET['recordID'])) && ($_GET['recordID'] != "")) {
$deleteSQL = sprintf("DELETE FROM tbslider WHERE idCont=%s",
GetSQLValueString($_GET['recordID'], "int"));

mysql_select_db($database_conexionnorthcontrols, $conexionnorthcontrols);
$Result1 = mysql_query($deleteSQL, $conexionnorthcontrols) or die(mysql_error());

$deleteGoTo = "slider_lista.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
?>

Gracias por su tiempo