This is the main.php with a date picker and is pointing to index.php
where I have the table with data. It work when I pick a date but when I make some changes to the index.php
page ex: edit data or if I go directly to index.php
I get :
Notice: Undefined index: arr_date in /Applications/XAMPP/xamppfiles/htdocs/zeta/index.php on line 112
<?php
include 'database.php';
$reponse = $bdd->query("SELECT * FROM live");
$reponse->closeCursor();
?>
<form action="index.php" method="post">
<input type="date" name="arr_date" value="FROM">
<input type="submit" value="Search">
</form>
index.php
<?php
include 'database.php';
$selected_date= $_POST['arr_date'];
$reponse = $bdd->query("SELECT * FROM live where
arr_date='$selected_date'");
while ($row = $reponse->fetch())
{
?>
Hi everybody, thank you for your help, for info this solved my problem:
<?php
session_start();
include 'db.php';
// Check Post variables are available
if(isset($_POST['select_date']))
{
$_POST['select_date']."";
// Set session variables
$_SESSION["select_date"] = $_POST['select_date'];
$_SESSION["select_date"]."";;
}
else
$_SESSION["select_date"];
//echo 'No, form submitted.';
$select_date = $_SESSION["select_date"];
$reponse = $bdd->query("SELECT * FROM live where
select_date='$select_date'");
while ($row = $reponse->fetch())
{