Ver Mensaje Individual
  #45 (permalink)  
Antiguo 12/09/2011, 14:24
lokor712
 
Fecha de Ingreso: septiembre-2011
Mensajes: 38
Antigüedad: 12 años, 8 meses
Puntos: 5
Respuesta: [APORTE] Sistema de noticias y comentarios

El archivo borrar.php debe quedar así:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Borrar registro</title>
</head>
<body>
<?php
require ('../includes/connect.php');
$result2=mysql_query("select * from noticias order by fecha Desc"$connect); 
while(
$row=mysql_fetch_array($result2))
    {
$foto $row['foto'];
    
$path="../uploads/".$foto;  
    if (!(
$foto == '../uploads/'))
        
unlink($path);
    }
$id =$_GET['id'];
$sql "DELETE FROM noticias WHERE id_noticia ='$id'";
$result mysql_query($sql$connect) or die("Error en consulta $sql:".mysql_error() );
header("Location: panel.php");
?>
</body>
</html>
A mi me funcionó de 10!!

Un Saludo!!