sorry for my bad english…
I want to get a date from a a html form but I don’t success…
I have a form with an input *date *and an input *submit* :
<input type="date" placeholder="Enter date here" name="date">
<input type="submit" name="submit" value="Submit">
And I would like to get the date. So I tried this:
<form method="post">
<input type="date" placeholder="Enter date here: 0000-00-00" name="date">
<input type="submit" name="submit" value="Submit">
<?php
if (isset($_POST['date']))
{
?><script>alert(<?php echo $_POST['date']; ?>)</script> <?php
}
?>
</form>
But when I click on submit, it displays a random date; example when I pick 2022-03-23, it displays 1996
…
Someone can help me? I searched but I didn’t find a correct answer.
Thank You