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

y este es el codigo del slider_remove, el cual elimina lo de la base de datos

Código PHP:
Ver original
  1. <?php require_once('Connections/conexionnorthcontrols.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6.   if (PHP_VERSION < 6) {
  7.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8.   }
  9.  
  10.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11.  
  12.   switch ($theType) {
  13.     case "text":
  14.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  15.       break;    
  16.     case "long":
  17.     case "int":
  18.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  19.       break;
  20.     case "double":
  21.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  22.       break;
  23.     case "date":
  24.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25.       break;
  26.     case "defined":
  27.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  28.       break;
  29.   }
  30.   return $theValue;
  31. }
  32. }
  33. unlink("images/slider/photo/".$image);
  34. echo $image;
  35.  
  36.   mysql_select_db($database_conexionnorthcontrols, $conexionnorthcontrols);
  37.   $Result1 = mysql_query($deleteSQL, $conexionnorthcontrols) or die(mysql_error());
  38.  
  39.   $deleteGoTo = "slider_lista.php";
  40.   if (isset($_SERVER['QUERY_STRING'])) {
  41.     $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
  42.     $deleteGoTo .= $_SERVER['QUERY_STRING'];
  43.   }
  44.   header(sprintf("Location: %s", $deleteGoTo));
  45.  
  46. ?>
  47. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  48. <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/plantilla_remove_slider.dwt.php" codeOutsideHTMLIsLocked="false" -->
  49. <head>
  50. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  51. <!-- InstanceBeginEditable name="doctitle" -->
  52. <title>Eliminar Slider</title>
  53. <!-- InstanceEndEditable -->
  54. <!-- InstanceBeginEditable name="head" -->
  55. <!-- InstanceEndEditable -->
  56. <link rel="shortcut icon" href="images/favicon.ico" />
  57. <link href="css/estiloadmin.css" rel="stylesheet" type="text/css" />
  58. </head>
  59.  
  60. <body>
  61. <div class="container">
  62.     <div class="header">
  63.         <?php include("includes/login.php"); ?>
  64.         <?php include("includes/cabezera.php"); ?>
  65.             <div class="clearfloat"></div>
  66. </div><div class="content">
  67.   <h1><strong>Eliminando Slider</strong></h1>
  68.     </div>
  69.     <div class="clearfloat"></div>
  70.     <div class="content1">
  71.      <p>Procesando....</p>
  72.  
  73.     </div>
  74.         <div class="sidebar1">
  75.         <ul class="nav">
  76.       <li><a href="slider_lista.php">Slider Principal</a></li>
  77.       <li><a href="galeria_lista.php">Galer&iacute;a</a></li>
  78.     </ul>
  79. </div>
  80.     <div class="clearfloat"></div>
  81.     <div class="footer">
  82.         <?php include("includes/pie_admin.php"); ?>
  83.         </div>
  84. </body>
  85. <!-- InstanceEnd --></html>