// if($submit == "Submit"){ // instead of using this one
if (isset($_POST['Submit'])) { //use this if your button has been clicked
$today = date("Y-m-d");
$query="insert into trial (id, fname, lname, address, mdate) values ('$id', '$fname', '$lname', '$address','$today')";
mysql_query($query) or die( "ERROR: " . mysql_error() . "\n");
}
// else if no button has clicked
{ echo "no clicked";
}
?>