23 lines
499 B
PHP
23 lines
499 B
PHP
<?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;
|
|
?>
|