
ingresar fechas en mysql con php
Publicado por Sebastian (1 intervención) el 31/05/2016 05:24:18
hola tengo un formulario con el siguiente codigo:
y este seria el archivo de proceso:
y no me ingresa nada ni tira error, solo me aparece una pagina en blanco y no encuentro la falla alguien me podra dar una mano? soy autodidacta y algunas cosas no las puedo resolver solo perdonen las molestias.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>INGRESAR PROVEEDORES CON FECHAS</title>
<link href="css/estilos.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="group">
<form action="registroconfecha.php" method="POST">
<h2><em>Ingreso de Proveedores</em></h2>
<label for="nombre">Nombre <span><em>(requerido)</em></span></label>
<input type="text" name="nombre" class="form-input" required/>
<label for="domicilio">DOMICILIO <span><em>(requerido)</em></span></label>
<input type="text" name="domicilio" class="form-input" required/>
<label for="fechapapel">FECHA <span><em>(requerido)</em></span></label>
<input type="text" name="txt_dia" size="4"class="form1-input">/
<input type="text" name="txt_mes" size="4" class="form1-input">/
<input type="text" name="txt_anio" size="4"class="form1-input">
<label for="telefono">Telefono <span><em>(requerido)</em></span></label>
<input type="text" name="telefono" class="form-input" />
<center> <input class="form-btn" name="submit" type="submit" value="Ingresar" /></center>
</p>
</form>
</div>
</body>
by Sebastian Acuña
</html>
y este seria el archivo de proceso:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
$db_host="localhost";
$db_user="root";
$db_password="nemesis";
$db_name="mandrakephp";
$db_table_name="ingconfecha";
$db_connection = mysql_connect($db_host, $db_user, $db_password);
if (!$db_connection) {
die('No se ha podido conectar a la base de datos');
}
$subs_name = utf8_decode($_POST['nombre']);
$subs_last = utf8_decode($_POST['domicilio']);
$subs_email = utf8_decode($_POST['telefono']);
$a = utf8_decode($_POST['txt_dia']);
$b = utf8_decode($_POST['txt_mes']);
$c = utf8_decode($_POST['txt_anio']);
$fechadepapel= $c.$b.$a;
$resultado=mysql_query("SELECT * FROM ".$db_table_name." WHERE Email = '".$subs_last."'", $db_connection);
if (mysql_num_rows($resultado)>0)
{
header('Location: Fail.html');
} else {
$insert_value = 'INSERT INTO `' . $db_name . '`.`'.$db_table_name.'` (`nombre` , `domicilio` , `telefono` , `fechadepapel` , `fechaderegistro` ) VALUES ("' . $subs_name . '", "' . $subs_last . '", "' . $subs_email . '", "' . $fechadepapel . '", "' NOW() '")';
mysql_select_db($db_name, $db_connection);
$retry_value = mysql_query($insert_value, $db_connection);
if (!$retry_value) {
die('Error: ' . mysql_error());
}
header('Location: Success.html');
}
mysql_close($db_connection);
?>
Valora esta pregunta


0