Viewing file: formuadt.php (4.3 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- http://www.lawebdelprogramador.com -->
<html>
<head>
<title>Ejemplo de formulario con estilos</title>
<style type="text/css">
BODY {
font-family: Arial;
font-size: 0.8em;
}
/* Estable el formato para todos los div's */
div {
clear: both;
}
/* Determina los div's que el contenido es centrado. Hereda "clear: both;" */
.form_center {
text-align:center;
}
/* Para los input's alineados */
.form_input_align {
float:left;
border:1px solid;
margin-left:0.2em;
}
/* Para los input's centrados */
.form_input_center {
border:1px solid;
}
/* Para los label's alineados */
.form_label_align {
float:left;
width:50%;
text-align:right;
}
/* indicamos una pequeña separación en cada label, input, select y textarea */
label, input, select, textarea {
margin-bottom:0.3em;
}
/* Unicamente funciona con Firefox
Determina el formato cuando se selecciona un cuadro de texto */
input:focus, select:focus, textarea:focus {
background-color: #c6d3ff;
}
/* Determina el formato de los comentarios */
.form_comment {
color: #808080;
}
/* Determina el formato de los comentarios centrados */
.form_comment_center {
text-align:center;
color: #808080;
}
/* Determina el formato de los botones */
.button {
padding: 0em 0.5em 0em 0.5em;
}
/* Determina el formato del marco */
fieldset {
border: 1px solid #808080;
padding: 0.5em 0.5em 0.5em 0.5em;
}
/* Determina el formato del titulo del marco */
legend {
color: #808080;
}
</style>
</head>
<body>
<h1 style="font-size:1em">Formulario patrocinadores</h1>
<form name="form1" method="get" enctype="application/x-www-form-urlencoded" target="_self">
<!-- generamos un recuadro -->
<fieldset>
<!-- titulo del recuadro -->
<legend>eres un ADT? o deber�as serlo y no est�s de alta?</legend>
<?php
include ("../frames/conn.php");
$conn2=mysql_connect("localhost","papyr225_phpb1","bJ8V1vmDPkHZ");
if ($_REQUEST['usuario'] ){
$sql="insert into patro_nuevos(usuario,correo_antiguo,fecha_donacion,correo_nuevo)
values
('".cleanInput($_REQUEST['usuario']).
"','".
cleanInput($_REQUEST['correo']).
"','".
cleanInput($_REQUEST['fecha']).
"','".
cleanInput($_REQUEST['correo_final'])."')";
mysql_query($sql,$conn2);
echo " Datos de <b>".cleanInput($_REQUEST['usuario'])."</b> recogidos. Muchas gracias";
}else{
?>Introduzca usuario
<input type="text" name="usuario" size="30" title="usuario">
<p>correo de paypal desde el que se ha hecho la donaci�n
<input type="text" name="correo" size="30" title="usuario"> </p>
<p>fecha aproximada de la donaci�n (a�o-mes-d�a, por ejemplo 2014-12-20)
<input type="text" name="fecha" size="30" title="usuario"></p>
<p>correo donde te notificaremos las novedades (�aunque coincida, deb�is ponerlo!)
<input type="text" name="correo_final" size="30" title="usuario"> </p>
<input type="submit" value="Enviar informaci�n">
<input type="reset" value="Borrar Formulario">
</fieldset>
</form>
<? }
function cleanInput($input) {
$search = array(
'@<script[^>]*?>.*?</script>@si', // Strip out javascript
'@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments
);
$output = preg_replace($search, '', $input);
return $output;
}
function sanitize($input) {
if (is_array($input)) {
foreach($input as $var=>$val) {
$output[$var] = sanitize($val);
}
}
else {
if (get_magic_quotes_gpc()) {
$input = stripslashes($input);
}
$input = cleanInput($input);
$output = mysql_real_escape_string($input);
}
return $output;
}
?>
|