Tengo una página para eliminar imágenes de una base de datos y funciona correctamente, pero al borrar la imagen se queda la pantalla en blanco y me gustaría que una vez borrada me redireccionase al menú otra vez.
He probado con "header" y en local me va bien, pero al subirlo al server no me redirecciona.
Dejo aquí el código, a ver si alguien me puede ayudar:
Código PHP:
<?include ("seguridad.php");?>
<?php require_once('../Connections/estepa.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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['id'])) && ($_GET['id'] != "")) {
$deleteSQL = sprintf("DELETE FROM archivos WHERE id=%s",
GetSQLValueString($_GET['id'], "int"));
mysql_select_db($database_estepa, $estepa);
$Result1 = mysql_query($deleteSQL, $estepa) or die(mysql_error());
}
mysql_select_db($database_estepa, $estepa);
$query_Recordset1 = "SELECT * FROM archivos";
$Recordset1 = mysql_query($query_Recordset1, $estepa) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>
<?php
header("location: jardines_del_im.php");
mysql_free_result($Recordset1);
?>
un Saludo!