Get server time and date as string and pass it to txt file
I'm trying to get server date and time and send it to email or write to
txt file from simple php form.
here is a sample of code
date_default_timezone_set('Europe/Zagreb');
$datum=date("y-m-d");
$upisufajl =
("\"{$_POST['firstName']}\",\"{$_POST['lastName']}\",\"{$_POST['email']}\",\"{$_POST['company']}\",\"{$_POST['datum']}\",\"{$_POST['oblik']}\",\"{$_POST['kategorija']}\",\"{$_POST['podkategorija']}\",\"{$_POST['message']}\"\n");
when do I need to write insted of {$_POST['datum']} to write date in txt
file. everything elese works fine, but it doesnt show date.
echo date("r"); shows date and time correctly. do I need to convert it to
string to be able to write it in txt file?
No comments:
Post a Comment