Ver Mensaje Individual
  #4 (permalink)  
Antiguo 19/01/2011, 18:52
Avatar de LuisCenardo
LuisCenardo
 
Fecha de Ingreso: noviembre-2010
Ubicación: Salta
Mensajes: 221
Antigüedad: 13 años, 5 meses
Puntos: 3
Respuesta: ayuda formulario

El codigo php que estoy usando es este.. lo que me lleva a una pagina vacia diciendo los mensajes que puse cuando se envie, gracias o error...
lo que me gustaria saber es mediante que codigo ese mensaje puede aparecer en donde se encontraba el formulario
MUCHAS GRACIAS..

Código PHP:
<?php

$to 
'[email protected]';


$name stripslashes($_POST['name']); //sender's name
$email stripslashes($_POST['email']); //sender's email
$website stripslashes($_POST['website']); //sender's website

//The subject
$subject  "[MENSAJE ENVIADO DESDE LA PAGINA DE SALTA VIRTUAL] "//The default subject. Will appear by default in all messages. Change this if you want.
$subject .= stripslashes($_POST['subject']); // the subject


$msg  "From : $name \r\n";  //add sender's name to the message
$msg .= "e-Mail : $email \r\n";  //add sender's email to the message
$msg .= "Website : $website \r\n"//add sender's website to the message
$msg .= "Subject : $subject \r\n\n"//add subject to the message (optional! It will be displayed in the header anyway)
$msg .= "---Message--- \r\n".stripslashes($_POST['message'])."\r\n\n";  //the message itself

//Extras: User info (Optional!)
//Delete this part if you don't need it
//Display user information such as Ip address and browsers information...
$msg .= "---User information--- \r\n"//Title
$msg .= "User IP : ".$_SERVER["REMOTE_ADDR"]."\r\n"//Sender's IP
$msg .= "Browser info : ".$_SERVER["HTTP_USER_AGENT"]."\r\n"//User agent
$msg .= "User come from : ".$_SERVER["HTTP_REFERER"]; //Referrer
// END Extras


     
{
        
error_reporting(0);

          if  (
mail($to$subject$msg"From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"))

          
//Message sent!
          //It the message that will be displayed when the user click the sumbit button
          //You can modify the text if you want
          
echo nl2br("
           <div class=\"MsgSent\">
            <h1>GRACIAS!!</h1>
            <p>tu mensaje ha sido enviado con exito <b><?=$name;?></b>, nos comunicaremos a la brevedad!<br /></p>
        </div>
       "
);

           else

        
// Display error message if the message failed to send
        
echo "
           <div class=\"MsgError\">
            <h1>Error!!</h1>
            <p>Lo siento <b><?=$name;?></b>, el envio ha fallado. intenta en unos minutos!</p>
        </div>"
;
    }
?>