form.2 (= anterior, pero con acceso a BD)
Código PHP:
Ver original<?php require_once('../Connections/contactos.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
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;
}
}
$query_Recordset1 = "SELECT * FROM contactos ORDER BY fechaentrada DESC";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Fornmulario de Contactos</title>
</head>
<body>
<h3>Formulario de Contactos</h3>
<form id="form1" name="form1" method="post" action="procesar.php">
<label> Ingrese su nombre <br />
<input name="nombre" type="text" id="nombre" />
<br />
</label>
<p>Su dirección Email<br />
<input name="email" type="text" id="email" />
</p>
<p>Su Número de teléfono <br />
<input name="telefono" type="text" id="telefono" />
</p>
<p>Tipo de contacto y tratamiento<br />
<label>
<select name="tipo" id="tipo">
<option value="primavera">Primavera</option>
<option value="verano">Verano</option>
<option value="Otoño">Otoño</option>
<option value="invierno">Invierno</option>
</select>
</label>
</p>
<p>
<label>Mensaje<br />
<textarea name="mensaje" cols="30" rows="3" id="mensaje"></textarea>
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="Enviar Formulario >>" />
</label>
</p>
<p><br />
</p>
</form>
</body>
</html>
<?php
?>