Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/11/2015, 14:16
juanunlin
 
Fecha de Ingreso: noviembre-2015
Mensajes: 3
Antigüedad: 8 años, 5 meses
Puntos: 0
Respuesta: Formulario de contacto

muchas gracias por la respuesta, si esta todos incluidos en la carpeta src, nose si tengo el php mal

es este
<?php
require('../src/autoload.php');
error_reporting(E_ALL ^ E_NOTICE);
$post = (!empty($_POST)) ? true : false;
if ($post)
{
$secret = '6Lc3iRATAAAAAMuITx6EJ-bx11pZmNilIp6-Ahv9';
$recaptcha = new \ReCaptcha\ReCaptcha($secret);
$resp = $recaptcha->verify($gRecaptchaResponse, $remoteIp);

if ($resp->isSuccess()) {
$to = '[email protected]'; // insert your email for contacts form sending data
$subject = stripslashes($_POST['name']) . " Fono Acustica";
$name = stripslashes($_POST['name']);
if (!filter_var(trim($_POST['email']), FILTER_VALIDATE_EMAIL))
{
echo 'Your email address must be in the format of [email protected]';
exit();
}
$email = trim($_POST['email']);
$message = trim($_POST['message']);
$website = trim($_POST['city']);
$message = "<br>$message <br><br>";
$message.="---<br>Best regards,<br><strong>$name</strong>";
if ($website)
{
$message.="<br><a href='$website'>$website</a>";
}
$Reply = $email;
$from = $name;


// Let's send the email.

$headers = "from: $from <$Reply>\nReply-To: $Reply \nContent-type: text/html";

$mail = mail($to, $subject, $message, $headers);

if ($mail)
{
echo 'success';
}
else
{
echo 'Something going wrong with sending mail...';
}
}
}
else
{
echo 'You can not access it directly!';
}
?>