if ($HTTP_GET_VARS["accion"] == "") {
?>
}
elseif ($HTTP_GET_VARS["accion"] == "enviar") {
// recojo las variables que vienen desde el formulario
$n_destinatario = $HTTP_POST_VARS["n_destinatario"];
$e_destinatario = $HTTP_POST_VARS["e_destinatario"];
$n_remitente = $HTTP_POST_VARS["n_remitente"];
$e_remitente = $HTTP_POST_VARS["e_remitente"];
// si los campos no están vacíos
if ($n_destinatario != "" && $e_destinatario != "" && $n_remitente != "" && $e_remitente != "") {
//indica la url de tu sitio
$url = "http://www.calpacifico.com/";
//indica el nombre de tu sitio
$nombre_del_sitio = "Cal Pacifico";
//indica el asunto del mensaje
$asunto = $n_remitente . " recommends that you visit this website";
//redacta el mensaje
$mensaje = "Hello " . $n_destinatario . ":
";
$mensaje .= $n_remitente . " recommends that you visit the website for " . $nombre_del_sitio . ".
Your message has been successfully sent to: '.$n_destinatario.' ';
echo ' ';
echo 'Thank you for recommending us!
';
echo '
';
// echo "
";
// echo ''
// echo "Your message has been successfully sent to: ". $n_destinatario . "";
//echo " Thank you for recommending us!";
}
//si existen campos vacíos, envía un mensaje de error
else {
echo "Por favor, es necesario que completes todos los campos. ";
echo "Pincha aquí para corregir los campos.";
}
}
?>