I am new to php and java etc, so i'm hacking it as i'm learning, but i've looked at every possible option and tried to adjust, but for some reason my code is still not working. I am calling the date and time in php file, and it submits the date and time to the email, but does not place it in my csv file (leaves a blank column).
I set the date and time with the first line and then the csv submit is after that (so i do not call the date and time via my html or anything
php
$combinedDT = date('Y-m-d H:i:s', strtotime("$date $time"));
//start of the csv submission form
$filename = "wedding_website_email_form.csv";
$string = array($_POST['combinedDT'],$_POST['name_surname'],$_POST['telephone'],$_POST['email_from'],$_POST['rsvp'],$_POST['attendees'],$_POST['song'],$_POST['comments']);
if (file_exists($filename)) {
$file = fopen($filename, 'a');
fputcsv($file, $string );
} else {
$file = fopen($filename, 'a');
$head_data=array("combinedDT","name_surname","telephone","email_from","rsvp","attendees","song","comments");
fputcsv($file,$head_data);
fputcsv($file, $string );
}
fclose($file);
Is there a different way to call it than to the email function that works?