Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/05/2011, 18:37
julslash
 
Fecha de Ingreso: febrero-2010
Ubicación: valencia
Mensajes: 146
Antigüedad: 14 años, 2 meses
Puntos: 3
tengo un error con el header

hola este codigo lo he utilizado anteriormente y funcionaba perfecto, pero no se que ocurre ahora estoy enviando un correo y me da este mensaje y deberia redireccionar a la misma pagina de php:


Su correo se ha enviado correctamente


Warning: Cannot modify header information - headers already sent by (output started at /home/partytim/public_html/pagina/paginas/correoperfecto/Scripts/correo.php:7) in /home/partytim/public_html/pagina/paginas/correoperfecto/Scripts/correo.php on line 317



este es el codigo php

Código PHP:


        
        
            <?php
if (!$_POST)

{
?>         
             
<form  id="formID" class="formular" method="post" action="correo.php">
        
        
        
      Nombre:
               <input name="nombre" type="text" class="validate[required,custom[onlyLetter]] text-input" id="nombre" value="" />
            
               Compañía:
                <input name="compania" type="text" class="validate[required,custom[onlyLetter]] text-input" id="compania" value="" />
            E-mail:
    <input name="email" type="text"  class="validate[required,custom[email]] text-input" id="email" value=""  />

            Teléfono:
            <input name="telefono" type="text" class="validate[required,custom[telephone]] text-input" id="telefono" value="" />

Tipo de evento:
<input name="tipo" type="text" class="validate[required,custom[onlyLetter]] text-input" id="tipo" value="" />

Fecha de evento:
<input name="fecha" type="text" class="validate[required,custom[date]] text-input" id="fecha" value="" />

Cómo nos conociste:

<input name="conociste" type="text" class="validate[required,custom[onlyLetter]] text-input" id="conociste" value="" />

Mensaje:

                      <textarea name="coment" class="textarea" id="coment" cols="17" rows="5" value=""></textarea>


<input class="submit" type="submit" value="Enviar"/>
        
        </form>     
                    
 <?php
}else{
    

    
//Estoy recibiendo el formulario, compongo el cuerpo
    
$headers_mensaje "From:" $_POST["email"] . "\r\n.." "Reply-To:"$_POST["email"] ."\r\n" "Return-path: "$_POST["email"] ."\r\n" "MIME-Version: 1.0\n" "Content-type: text/plain; charset=$UTF-8"
    
    
$cuerpo "Enviado de la pagina web www.partytime.com\n";
    
$cuerpo .= "Nombre: " $_POST["nombre"] . "\n";
    
$cuerpo .= "Compañía: " $_POST["compania"] . "\n";
    
$cuerpo .= "Email: " $_POST["email"] . "\n";
    
$cuerpo .= "Teléfono: " $_POST["telefono"] . "\n";
    
$cuerpo .= "Tipo de evento: " $_POST["tipo"] . "\n";
    
$cuerpo .= "Fecha de evento: " $_POST["fecha"] . "\n";
    
$cuerpo .= "Cómo nos conociste: " $_POST["conociste"] . "\n";
    
$cuerpo .= "Mensaje: " $_POST["coment"] . "\n";
    
    
    
//funcion ////////////////////////
    
    
function fixEncoding($in_str){
    
$cur_encoding mb_detect_encoding($in_str) ;
    if(
$cur_encoding == "UTF-8" && mb_check_encoding($in_str,"UTF-8"))
    return 
$in_str;
    else
    return 
utf8_encode($in_str);
};
  
/////////////////////
  
    //mando el correo...
    
$destino    '[email protected]';
    
mail($destino,"Respuesta de partytimedesign.com",$cuerpo$headers_mensaje);

    
//doy las gracias por el envío
    
echo"<center>";
    echo 
"<table width='400' border='0' aling='center'>";
            echo 
"<tr>"
    echo
"<td>&nbsp;</td>";
    echo
"<td>&nbsp;</td>";
    echo
"<td>&nbsp;</td>";
    echo
"</tr>";
            echo 
"<tr>"
    echo
"<td>&nbsp;</td>";
    echo
"<td>&nbsp;</td>";
    echo
"<td>&nbsp;</td>";
            echo
"</tr>";
         echo
"<tr>";
    echo
"<td>&nbsp;</td>";
    echo
"<td> <center><span class='Estilo2'>Su correo se ha enviado correctamente</span></center></td>";
    echo
"<td>&nbsp;</td>";
            echo
"</tr>";
echo
"</table>";
echo
"</center>";

    
header("Refresh: 5; URL=correo.php");
    
}
?>