<?php
$data = json_decode(file_get_contents('php://input'), true);
if($data['email']) {
$output = fopen('regs.csv', 'a') or die('hey');
fwrite($output, "\n".'"'.$data['name'].'","'.$data['email'].'",'.date('Y-m-d H:m:s'));
fclose($output);
}