-3

I'm trying to post the time/date on a variable from a form but I got an error saying unknown variable. This is my code

html

    <div class="form-group">
            <labe for="dp">Departure Date</label>
            <input type="date" name="depdate" class="form-control" id="dp">
    </div>

php post

global $fromlocation, $todestination, $depdate, $deptime;

    if(isset($_POST['btn-sf'])){
        $depdate = $_POST['date'];
        //echo $depdate;
    }

how to get selected date time values without using datepicker on javascript

1 Answers1

0

Maybe

$depdate = $_POST['yourFormName']['date'];

To see what is in POST try use:

var_dump($_POST);
Katarzyna
  • 111
  • 11