me dice que hay errores en el php
Undefined index: Time_Destination in C:\wamp64\www\colorlib-regform-5\server2.php on line 13
Undefined index: Time_Destination in C:\wamp64\www\colorlib-regform-5\server2.php on line 15
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value: ':day' for column 'Time_date' at row 1' in C:\wamp64\www\colorlib-regform-5\server2.php on line 36
Invalid datetime format: 1292 Incorrect date value: ':day' for column 'Time_date' at row 1 in C:\wamp64\www\colorlib-regform-5\server2.php on line 36
La carpeta del server2:
<?php
// declaración de variable
$errors = array();
// conectarse a la base de datos
include('connection.php');
// REGISTRO DE CITA
if (isset($_POST['appointment'])) {
// recibir todos los valores de entrada del formulario
$Time_Date = $_POST['Time_Date'];
$Time_Hours = $_POST['Time_Hours'];
$Time_Contact = $_POST['Time_Contact'];
$Time_Destination = $_POST['Time_Destination'];
if ($Time_Destination=$_POST['Time_Destination']) {
$Time_Destination=$_POST['Time_Destination'];
}else{
$Time_Destination="";
}
// validación de formularios: asegúrese de que el formulario esté correctamente rellenado
if (empty($Time_Date)) { array_push($errors, "Día de la cita requerida"); }
if (empty($Time_Contact)) { array_push($errors, "Direccion es requerida"); }
if (empty($Time_Destination)) { array_push($errors, "Destinación es requerido"); }
if (empty($Time_Hours)) { array_push($errors, "Hora es requerido"); }
// registrar usuario si no hay errores en el formulario
$query = "INSERT INTO Dim_Time (Time_date, Time_Contact, Time_Destination,Time_Hours)
VALUES(':day', ':address', ':Destination',':Hours')";
$get=$db->prepare($query);
$get->execute(array(":day" => $Time_Date,":address" => $Time_Contact,":Destination" => $Time_Destination, ":Hours" => $Time_Hours));
if ($get==false) {
echo "<script>alert('error en la consulta')</script>";
}else{
echo "Exito en la consulta";
header('location: index.php');
}
}
?>
La carpeta del index.php
<?php include('server2.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Colorlib Templates">
<meta name="author" content="Colorlib">
<meta name="keywords" content="Colorlib Templates">
<!-- Title Page-->
<title>www.BrickDigital.Com</title>
<!-- Icons font CSS-->
<link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
<!-- Font special for pages-->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">
<!-- Vendor CSS-->
<link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
<link href="vendor/datepicker/daterangepicker.css" rel="stylesheet" media="all">
<!-- Main CSS-->
<link href="css/main.css" rel="stylesheet" media="all">
</head>
<body>
<div class="page-wrapper bg-gra-03 p-t-45 p-b-50">
<div class="wrapper wrapper--w790">
<div class="card card-5">
<div class="card-heading">
<h2 class="title">Agendar Cita</h2>
</div>
<div class="card-body">
<form method="post" action="index.php">
<div class="form-row m-b-55">
<div class="value">
<div class="row row-space">
<div class="col-2">
<div class="input-group-desc">
<input class="style-input" type="date" name="Time_Date" >
</div>
</div>
<div class="col-2">
<div class="input-group-desc">
<input class="style-input" type="time" name="Time_Hours" value="7:00:00" max="17:00:00" min="10:00:00">
</div>
</div>
</div>
</div>
</div>
<div class="form-row m-b-55 center-block">
<div class="value">
<div class="row2 row-refine">
<div class="col-12">
<div class="input-group-desc">
<input class="style-input" type="text" name="Time_Contact" placeholder="Dirección">
</div>
</div>
</div>
</div>
</div>
<div class="form-row">
<div class="value">
<div class="input-group">
<div class="rs-select2 js-select-simple select--no-search">
<select name="Time_Destination">
<option disabled="disabled" selected="selected" name="">Destinación</option>
<option value="Campo Valdez" <?php if($Time_Destination=="Campo Valdez") echo "selected" ?>>Campo Valdez</option>
<option value="Aranjuez" <?php if($Time_Destination=="Aranjuez") echo "selected" ?>>Aranjuez</option>
<option value="Bello" <?php if($Time_Destination=="Bello") echo "selected" ?>>Bello</option>
</select>
<div class="select-dropdown"></div>
</div>
</div>
</div>
</div>
<div>
<button class="btn btn--radius-2 btn--red" type="submit" name="appointment" value="appointment">Cita</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Jquery JS-->
<script src="vendor/jquery/jquery.min.js"></script>
<!-- Vendor JS-->
<script src="vendor/select2/select2.min.js"></script>
<script src="vendor/datepicker/moment.min.js"></script>
<script src="vendor/datepicker/daterangepicker.js"></script>
<!-- Main JS-->
<script src="js/global.js"></script>
</body><!-- This templates was made by Colorlib (https://colorlib.com) -->
</html>
<!-- end document-->
la carpeta connection.php
<?php
try{
$db = new PDO ('mysql:host=localhost;dbname=brickdigital', 'root', '');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}catch (Exception $e){
die('Error'. $e->getMessage());
echo "Linea de error" . $e->getLine();
}
?>
(Gracias por la atención prestada)