Hola tengo una aplicacion bastante sencilla , es una tabla con los campos: id(int), nombre(varchar), fecha1, fecha2
tengo este codigo en html:
Código HTML:
Ver original<!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"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css" />
$(function() {
$( "#datepicker1" ).datepicker();
$( "#datepicker2" ).datepicker();
});
<form action="ingresar.php" method="post"> Escribe tu id:
<input type="text" name="id" size="2"> Escribe tu nombre:
<input type="text" name="nombre" size="10"> <p>fecha1:
<input type="text" id="datepicker1" name="fecha1"/></p> <p>fecha2:
<input type="text" id="datepicker2" name="fecha2"/></p> <input type="submit" value="Entrar">
y tengo este en ingresar.php:
Código PHP:
Ver original<?php
$id=$_POST["id"];
$nombre=$_POST["nombre"];
$fecha1=$_POST["fecha1"];
$fecha2=$_POST["fecha2"];
$sql="INSERT INTO tablaPrueba (id,nombre,fecha1,fecha2) VALUES ($id,$nombre,$fecha1,$fecha2)";
?>
el preblema que cuando le doy en entrar, me muestra toda la sintaxis del php sin guardar los datos
Gracias por la ayuda