Ver Mensaje Individual
  #5 (permalink)  
Antiguo 28/10/2009, 13:26
Raftuz
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: Subir pagina php

<?php require_once('../Connections/Conexion.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($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 correo (id, Email) VALUES (%s, %s)",
GetSQLValueString($_POST['Email'], "int"),
GetSQLValueString($_POST['Email'], "text"));

mysql_select_db($database_Conexion, $Conexion);
$Result1 = mysql_query($insertSQL, $Conexion) or die(mysql_error());
}
?>
Unas direciones xD

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Invitaciones</title>
</head>


<body>
<form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">
<p>Correo Electronico:
<label for="Email"></label>
<input type="text" name="Email" id="Email" />
</p>
<p>
<label for="Enviar"></label>
<input type="submit" name="Enviar" id="Enviar" value="Enviar" />
</p>
<input type="hidden" name="MM_insert" value="form1" />
</form>
</body>
</html>