2015-01-23 13:09:30 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
session_start ();
|
|
|
|
|
|
|
|
$params = array
|
|
|
|
(
|
|
|
|
'name'
|
|
|
|
,'pc'
|
|
|
|
,'phone'
|
2015-02-17 11:48:53 +00:00
|
|
|
,'email'
|
|
|
|
,'message'
|
2015-01-23 13:09:30 +00:00
|
|
|
,'captcha'
|
|
|
|
);
|
|
|
|
|
|
|
|
$paramsOk = TRUE;
|
|
|
|
|
|
|
|
foreach ($params as $param)
|
|
|
|
if (!isset ($_POST[$param]) || $_POST[$param] == '')
|
|
|
|
{
|
|
|
|
$paramsOk = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
header ('Content-Type: application/json');
|
|
|
|
|
|
|
|
if ($paramsOk && isset ($_SESSION['captcha'])
|
|
|
|
&& $_POST['captcha'] == $_SESSION['captcha'])
|
|
|
|
{
|
|
|
|
mail ('nuria@verdnatura.es', 'Verdnatura', print_r ($_POST, TRUE),
|
|
|
|
'From: Verdnatura <www-data@verdnatura.es>');
|
|
|
|
|
|
|
|
echo json_encode (TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
echo json_encode (FALSE);
|
|
|
|
|
|
|
|
unset ($_SESSION['captcha']);
|
|
|
|
|
|
|
|
?>
|