Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/06/2005, 10:25
sintesk7
 
Fecha de Ingreso: agosto-2004
Mensajes: 349
Antigüedad: 19 años, 8 meses
Puntos: 3
problema con header

Hola a todos,

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&iacute;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);
?>
Gracias por su ayuda.

un Saludo!