estoy creando un blog, y antes de subir las imágenes al servidor las muestro, puedo elegir tantas imágenes como quiera, debajo de cada imagen me aparece un botón con el suiguente <a href>:
<a href="imagenes_blog.php?foto_borrar=<?php echo $popo[$i]?>">
y el código es:
Código PHP:
<?php
$ruta_imagen=$_GET['ruta'];
$borrar=$_GET['foto_borrar'];
if($borrar!=NULL)
{
//echo $borrar;
$imagenes=$_SESSION['foto'];
$i=0;
$j=0;
while($imagenes[$j]!=NULL)
{
//echo $imagenes[$j];
if($imagenes[$j]!=$borrar)
{
$imagenes_a[$i]=$imagenes[$j];
$i++;
}
$j++;
}
$imagenes=$imagenes_a;
$_SESSION['foto']=$popo;
}
else
{
if($ruta_imagen!=NULL)
{
//echo $ruta_imagen;
if($_SESSION['foto']==NULL)
{
$rut=array();
$rutimagen[0]=$ruta_imagen;
$_SESSION['foto']=$rutimagen;
$popo=$_SESSION['foto'];
}
else
{
$foto=$_SESSION['foto'];
$num=count($foto);
$rutimagen=$_SESSION['foto'];
$rutimagen[$num]=$ruta_imagen;
$_SESSION['foto']=$rutimagen;
$popo=$_SESSION['foto'];
}
}
}
?>
Muchas gracias y saludos
![Adios](http://static.forosdelweb.com/fdwtheme/images/smilies/adios.gif)