How can I save the form data in a file or a local db (maybe using AJAX) which send the data via form action to an external db?
The source code for my form is here: http:
PHP:
Below is the data retrieved from SERVER
Server Timezone : ' . date_default_timezone_get() . '';
$current_date = date('d/m/Y == H:i:s ');
print "Server Time : " . $current_date . "
";
$dataObject = $_POST; //Fetching all posts
echo ""; //making the dump look nice in html.
var_dump($dataObject);
echo "
";
//Writes it as json to the file, you can transform it any way you want
$json = json_encode($dataObject);
file_put_contents('your_data.txt', $json);
?>
JS: