Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/04/2013, 19:09
Avatar de Most
Most
 
Fecha de Ingreso: marzo-2009
Mensajes: 642
Antigüedad: 15 años, 11 meses
Puntos: 6
Respuesta: problema con ñ y acentos en formulario contacto

debes usar este meta para que te reconozca los caracteres españoles:

<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />


Código PHP:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
</head>
</html>

<?php

$to 
"Prueba <[email protected]>";
$subject $_POST['asunto'];
$nombre $_POST['nombre'];
$telefono $_POST['tel'];
$from $_POST['email'];
$mensaje $_POST['comentario'];
mysql_query("SET NAMES utf8");
$hoy date ("d F Y");

$message "\t\t\t$hoy\n\n";


$message $message "Asunto: $subject\n";
$message $message "E-Mail: $from\n";
$message $message "Nombre: $nombre\n";
$message $message "Telefono: $telefono\n";
$message $message "Comentario: $mensaje\n\n";

$headers "From: $Nombre <$from>\r\n";
$headers .= "Reply-To: $Nombre <$from>\r\n";

if ( 
mail($to,$subject,$message,$headers) )
{
Header("Location: enviado.htm");
}
else
{
Header("Location: error.htm");
}
?>

Última edición por Most; 28/04/2013 a las 19:15