Tema: iframe y php
Ver Mensaje Individual
  #18 (permalink)  
Antiguo 03/01/2003, 07:49
xias
 
Fecha de Ingreso: enero-2002
Mensajes: 838
Antigüedad: 22 años, 4 meses
Puntos: 1
y este el codigo php.

<?php require_once('Connections/aviso.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 = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}

if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO datos_temporal (nombre, contacto, domicilio, poblacion_provincia, cp, email, telefono, fax, direccion_misma, otra_direccion, conocido_por, tipo_pto, fecha_hora) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, '$conectado', '$otra_direccion', '$conocido', '$tipo', now())",

GetSQLValueString($HTTP_POST_VARS['nombre'], "text"),
GetSQLValueString($HTTP_POST_VARS['contacto'], "text"),
GetSQLValueString($HTTP_POST_VARS['domicilio'], "text"),
GetSQLValueString($HTTP_POST_VARS['poblacion_provincia'], "text"),
GetSQLValueString($HTTP_POST_VARS['cp'], "int"),
GetSQLValueString($HTTP_POST_VARS['email'], "text"),
GetSQLValueString($HTTP_POST_VARS['telefono'], "int"),
GetSQLValueString($HTTP_POST_VARS['fax'], "int"),
GetSQLValueString($HTTP_POST_VARS['direccion_misma'], "text"),
GetSQLValueString($HTTP_POST_VARS['otra_direccion'], "text"),
GetSQLValueString($HTTP_POST_VARS['conocido_por'], "text"),
GetSQLValueString($HTTP_POST_VARS['tipo_pto'], "text"),
GetSQLValueString($HTTP_POST_VARS['fecha_hora'], "date"));


mysql_select_db($database_aviso, $aviso);
$Result1 = mysql_query($insertSQL, $aviso) or die(mysql_error());
}

mysql_select_db($database_aviso, $aviso);
$query_Recordset1 = "SELECT * FROM datos_temporal";
$Recordset1 = mysql_query($query_Recordset1, $aviso) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>


un saludo


gracias