Los datos son enviados bien pero me sale el siguiente error :
Código PHP:
[B]Warning: Cannot modify header information - headers already sent in datos.php on line 54[/B]
Le dejo el codigo para ver si me pueden ayudar...
Código PHP:
<?php virtual('/Connections/datos.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;
}
$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'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>