Ver Mensaje Individual
  #6 (permalink)  
Antiguo 27/06/2006, 19:22
heba80
 
Fecha de Ingreso: noviembre-2004
Mensajes: 496
Antigüedad: 19 años, 5 meses
Puntos: 0
este es el codigo (q se genero en dream) en el mismo form donde se llenan los datos:
<?php require_once('Connections/connections1.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"] == "form1")) {
$insertSQL = sprintf("INSERT INTO operacion (monto, banco, noperacion, rem_nombre, rem_apellido, rem_telefono, rem_mail, rem_mensaje, ben_nombre, ben_apellido, ben_telefono, ben_mail) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['monto'], "int"),
GetSQLValueString($_POST['banco'], "text"),
GetSQLValueString($_POST['operacion'], "text"),
GetSQLValueString($_POST['nombre_re'], "text"),
GetSQLValueString($_POST['apellidos_re'], "text"),
GetSQLValueString($_POST['telefono_re'], "text"),
GetSQLValueString($_POST['mail_re'], "text"),
GetSQLValueString($_POST['mensaje_re'], "text"),
GetSQLValueString($_POST['nombre_be'], "text"),
GetSQLValueString($_POST['apellido_be'], "text"),
GetSQLValueString($_POST['telefono_be'], "text"),
GetSQLValueString($_POST['mail_be'], "text"));

mysql_select_db($database_connections1, $connections1);
$Result1 = mysql_query($insertSQL, $connections1) or die(mysql_error());

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