I created a program that allows u to type in the date and then when u click submit it should say whether the date u typed matches the CURRENT DATE (so the date updates itself) anyways, i am not so good at php and this is what i could make: whats the problem and can u demonstrate how to fix it.
<?php
session_start();
$EntryError="";
if (isset($_POST['submit'])){
$entrydate = "";
$errorOccured = false;
if (isset($_POST['tsmdate'])){
$entrydate = trim($_POST['tsmdate']);
if (strlen($entrydate) == 0){
$EntryError = "date is missing";
$errorOccured = true;
}
}
else{
$EntryError = "date is missing";
}
}
$presentDate=date('Y-m-d');
if($date==$presentDate)
{
echo "same date";
}
else{
echo "different date";
}
?>
<html>
<head>
</head>
<body>
<form name="dates" id="dates" method="POST" action="">
<table cellpadding="5" border="0" width="100%">
<tr>
<td colspan="3" align="center">
<h1> select dates </h1>
</td>
</tr>
<tr>
<td width="30%" align="right">
<label for="tsmdate">Entry date </label>
</td>
<td align="left">
<input type="date" name="tsmdate" id="tsmdate" required="required">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="dates">
</td>
</tr>
</table>
</form>
</body>
</html>