I have the following form and I am wondering if I can just enter all the information including the date in the form to get it submitted to the database without using the data(“Y-m-d”); at all? or must I use the date(“Y-m-d”) in my processing section?
<form class="signup-form" action="update_database_maintenance_level1_form.php" method="POST">
<label>Enter Level 1 Maintenance Name:</label>
<br /><br />
<input type="text" name="name" placeholder="Enter Level 1 Maintenance Name">
<br /><br />
<label>Enter Level 1 Maintenance Description</label>
<br /><br />
<textarea name="describe" placeholder="Enter Level 1 Maintenance Description"></textarea>
<br /><br />
<label>Enter Level 1 Maintenance Date:</label>
<br /><br />
<input type="text" name="date" placeholder="Enter Level 1 Maintenance Date">
<br /><br />
<label>Enter Level 1 Maintenance Status:</label>
<br /><br />
<select name="status">
<option value="" selected="selected">Enter Level 1 Maintenance Status:</option>
<option value="High">High Priority</option>
<option value="Medium">Medium Priority</option>
<option value="Low">Low Priority</option>
</select>
<input type="hidden" name="csrf" value="<?php echo $_SESSION['key']; ?>">
<button type="submit" name="submit">Update Level 1 Maintenance</button>
</form>
In my other page, I have defined all the variables and my date variable is $date = strip_tags($_POST[‘date’]); but when I entered the information, it just shows as…
0000-00-00 00:00:00
I have set my database as timestamp