apxtrib/nationschainssave/tribes/smatchit/www/presentation/save.php

23 lines
499 B
PHP
Raw Normal View History

2023-04-29 06:32:56 +00:00
<?php
$email = $_POST['email'];
$user_type = $_POST['user_type'];
$date = date('d/m/Y');
$fp = fopen('_emails.csv', 'a');
if (flock($fp, LOCK_EX))
{
fputcsv($fp, array($email,$user_type,$date));
flock($fp, LOCK_UN); // unlock the file
$response = true;
} else {
// flock() returned false, no lock obtained
//print "Could not lock $filename!\n";
$response = false;
}
fclose($fp);
echo $response;
?>