Help with PHP Code and Submit Button?

Nicholas

New member
Ok so I have to fix some PHP code. I need to make a data entry box, so the user can enter the date. Then they hit the submit button to register it. Then the Date variable will be redefined to equal the entered date.


$tomorrow = mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"));
echo "<center>Date:<input type=text name=date value='" . date('Y-m-d', $tomorrow) .
"'><br>"; ?>

<form action='submit.php' method='post'>
<input type='submit' name='submit' value='Submit'><br><br>
</form>

So this makes the empty data box, puts tomorrow's date in there, and then makes the submit button. But I can't get the date value re-defined.

Then I use this to redefine the date variable.
if ($_POST['submit'])
$date = $_POST['submit'];

Any help would be greatly appreciated.
 
Back
Top