Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/06/2012, 09:39
pucelalicant
 
Fecha de Ingreso: enero-2012
Mensajes: 4
Antigüedad: 12 años, 4 meses
Puntos: 0
No me redirige la pagina después de enviar formulario

Hola a todos, mi pregunta es el porque no me redirige a la pagina contactos_ok.php despues de enviar el formulario de la pagina contacto.php, por mas que lo intento cambiano el header de lugar no lo consigo.
En el servidor de prueba si que funciona pero en el de pago no...
Si alguien sabe como se puede solucionar

<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) :

mysql_escape_string($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;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO tblcontactos (strNombre, strEmail, intInteres, strComentarios)

VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['strNombre'], "text"),
GetSQLValueString($_POST['strEmail'], "text"),
GetSQLValueString($_POST['intInteres'], "int"),
GetSQLValueString($_POST['strComentarios'], "text"));

mysql_select_db($database_seredelllagosti, $seredelllagosti);
$Result1 = mysql_query($insertSQL, $seredelllagosti) or die(mysql_error());

$insertGoTo = "contacto_ok.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));}
?>