Ver Mensaje Individual
  #11 (permalink)  
Antiguo 09/06/2007, 01:02
Avatar de korg1988
korg1988
 
Fecha de Ingreso: junio-2006
Ubicación: Santa Fe, Argentina
Mensajes: 825
Antigüedad: 17 años, 10 meses
Puntos: 19
De acuerdo Re: [B]Error en PHP... Ayuda[/B]

Hermano esto es muy facil y lamento tener que corregir a los uqe pusieron al final de el codigo el flush
esto lo tienes que hacer de la siguiente forma
Código PHP:
 <?php virtual('/Connections/datos.php'); ?>
<?php
ob_start
();
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;
}

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

if ((isset(
$_POST["MM_insert"])) && ($_POST["MM_insert"] == "form3")) {
  
$insertSQL sprintf("INSERT INTO datos (rut, dverificador, nombre, email, direccion, comuna, ciudad, pais, carea, telefono) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['rut'], "text"),
                       
GetSQLValueString($_POST['dverificador'], "text"),
                       
GetSQLValueString($_POST['nombre'], "text"),
                       
GetSQLValueString($_POST['email'], "text"),
                       
GetSQLValueString($_POST['direccion'], "text"),
                       
GetSQLValueString($_POST['comuna'], "text"),
                       
GetSQLValueString($_POST['ciudad'], "text"),
                       
GetSQLValueString($_POST['pais'], "text"),
                       
GetSQLValueString($_POST['carea'], "text"),
                       
GetSQLValueString($_POST['telefono'], "text"));

  
mysql_select_db($database_datos$datos);
  
$Result1 mysql_query($insertSQL$datos) or die(mysql_error());

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

?>

ob_clea
n();

header(sprintf("Location: %s", $insertGoTo));
exit();
con el ob_clean() limpias el buffer antes de que se haga el redireccionamiento sino que sentido tiene hacerlo al final luego del header seria lo mismo que no ponerlo, tienes que limpiar el buffer antes de redireccionar, exactamente en el momento del redireccionamiento lo limpias y le pones un exit() para que no pierda tienmpo con lo que sigue de codigo
Suerte despues me contas como te fue