Ver Mensaje Individual
  #7 (permalink)  
Antiguo 08/06/2007, 22:11
Avatar de hectorejch
hectorejch
 
Fecha de Ingreso: junio-2005
Ubicación: Argentina
Mensajes: 172
Antigüedad: 18 años, 10 meses
Puntos: 2
Re: [B]Error en PHP... Ayuda[/B]

Ok, no hay problema, prueba con esto, si no te funciona ahi vemos :D
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'];
  }
  
header(sprintf("Location: %s"$insertGoTo));
}
ob_end_flush();
?>
__________________
"El Reino de Dios no consiste en palabras, sino en poder"