Basically I've got a contact us form, and I would like to submit the date as well, when the submit button is pressed. Basically you fill out the boxes, submit, and the date goes through with it. I am just not sure exactly how to do it...
I've got the form in a .php in another page, but the action leads to the current page.
The date needs to be: year-mm-dd
<?php
include 'connection.php';
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$question = $_POST['question'];
$date = //I need the date here so it can go through the insert propperly;
if ($_POST['submit']){
mysqli_query($connect,"INSERT INTO contactusresults (`id`, `date`, `name`, `email`, `phone`, `question`) VALUES (NULL, '$date', '$name', '$email' , '$phone', '$question')") or die(mysql_error());
header('Location: ../pages/index.php');
//change to submit page
}else{
header('Location: ../pages/index.php');
}
?>