?
| Current Path : /home/webyoo/www/backup/allback/france-reseaux/ |
| Current File : /home/webyoo/www/backup/allback/france-reseaux/coregistration.php |
<?php header("Access-Control-Allow-Origin: *");
extract($_GET);
$return = 'KO';
function lptocsv($data,$filename='demo'){
$fp = fopen($filename.'.csv', 'a');
fputcsv($fp, $data);
fclose($fp);
}
$id = "";
/* $email='arnaud@webrivage.com';
$lastname='adam';
$civility='mr';
$birthday='1981-01-01'; */
function chaine_aleatoire($nb_car, $chaine = '123456789')
{
$nb_lettres = strlen($chaine) - 1;
$generation = '';
for($i=0; $i < $nb_car; $i++)
{
$pos = mt_rand(0, $nb_lettres);
$car = $chaine[$pos];
$generation .= $car;
}
return $generation;
}
$id = "30".chaine_aleatoire(8);
if($email !="" && $firstname !="" && $lastname !="" && $civility !="" && $cp !="" && $birthday !="")
{
$date=date("d/m/Y H:i:s");
$data=array(
'Id'=>$id,
'Date'=>$date,
'Email'=>$email,
'Civilite'=>$civility,
'Prenom'=>$firstname,
'Nom'=>$lastname,
'Code postal'=>$cp,
'Birth'=>$birthday,
'Telephone'=>$phone,
'Rappel'=>'',
);
lptocsv($data,'extract-ilan2');
$return = 'OK';
}
echo $return;
?>