Foros del Web » Programando para Internet » PHP »

Problemas con planillas de contacto

Estas en el tema de Problemas con planillas de contacto en el foro de PHP en Foros del Web. Que tal gente??' Tengo un problema con esta planilla de contacto en php... no esta funcionando bien.... no esta enviando la informacion correctamente, no me ...
  #1 (permalink)  
Antiguo 09/02/2011, 16:47
 
Fecha de Ingreso: julio-2005
Mensajes: 23
Antigüedad: 18 años, 9 meses
Puntos: 0
Problemas con planillas de contacto

Que tal gente??'

Tengo un problema con esta planilla de contacto en php... no esta funcionando bien.... no esta enviando la informacion correctamente, no me aparecen todos los campos solamente los de text que va en donde dice comentario... ya me estoy volviendo loco y no se que es

Mi codigo sendmail.php
Código:
<?php

$mailto = "[email protected];[email protected]";
$messagesubject = "Email enviado desde la web";

$author = $_POST['author'];

$fromaddress = $_POST['email'];

if(isset($_POST['telf'])){
$telf = $_POST['telf'];
}else{$telf = "No coloco telefono";}

if(isset($_POST['ciudad'])){
$ciudad = $_POST['ciudad'];
}else{$ciudad = "No coloco ciudad";}

$body = $_POST['text'];

$message = 
$author." envio un email:\r\n Mensaje: "
$email."\r\nTelefono: " 
$telf."\r\nCiudad: " 
$ciudad."\r\n\n\nMessage:\r\n<----BEGINNING OF MESSAGE!---->\r\n"
$body."\r\n\n<----END OF MESSAGE!---->\r\n";

$eol = "\r\n";
$mime_boundary=md5(time());

  $headers .= 'From: '.$author.' .<'.$fromaddress.'>'.$eol;
  $headers .= 'Reply-To: '.$author.' .<'.$fromaddress.'>'.$eol;
  $headers .= 'Return-Path: '.$author.' .<'.$fromaddress.'>'.$eol;
  $headers .= "Message-ID: <".time()." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
  $headers .= "X-Mailer: PHP v".phpversion().$eol;
  $headers .= 'MIME-Version: 1.0'.$eol;
  $headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol;

$msg .= "Content-Type: multipart/alternative".$eol;
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= strip_tags(str_replace("<br>", "\n", $message)).$eol.$eol;
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= str_replace("\n", "<br>", $message).$eol.$eol;
$msg .= "--".$mime_boundary."--".$eol.$eol; 
ini_set(sendmail_from, $fromaddress);  // the INI lines are to force the From Address to be used !
$formsent = mail($mailto, $messagesubject, $msg, $headers);
ini_restore(sendmail_from);

if ($formsent) {
	echo "<fieldset style='background-color:#FFFFCC;'><legend>¡Gracias! ".$author."</legend><p>ya recibimos tu email, te contestaremos a la brevedad posible.</p></fieldset>";
	}else{
	echo "Hubo un problema con la planilla de contact, intenta de nuevo";
	}
?>


Mi codigo html:
Código:
<form method="post" name="contact" id="contact_form"  class="leyenda" action="sendmail.php">
<div class="clear"><h2>Formulario de contacto</h2><br/></div>
<input type="hidden" name="post" value=" Send " />

<div class="float">
<label for="author">* Nombre:</label><br/>
<input type="text" id="author" name="author" class="required" />
</div>
<div class="float" style="clear:right">
<label for="email">* Correo electronico:</label><br/>
<input type="text" id="email" name="email" class="required email" />
</div>
<div class="float">
<label for="telf">Telefono de contacto:</label><br/>
<input type="text" name="digits" id="telf" class="digits" />
</div>
<div class="float">
<label for="ciudad">Ciudad / Localidad</label><br/>
<input type="text" name="ciudad" id="ciudad" /><br/><br/>
</div>
<div style="clear:both">
<label for="text">* Comentario:</label><br />
<textarea id="text" name="text" rows="6" cols="42" class="required"></textarea><br /><br />
<input type="submit" name="submitbutton" id="submitbutton" value=" Enviar " />
<div id="progress" style="display:none;">Enviando...</div>
</div>
</form>


Saludos y gracias por su ayuda!
  #2 (permalink)  
Antiguo 10/02/2011, 08:07
 
Fecha de Ingreso: julio-2005
Mensajes: 23
Antigüedad: 18 años, 9 meses
Puntos: 0
Respuesta: Problemas con planillas de contacto

alguien tiene alguna idea?
  #3 (permalink)  
Antiguo 10/02/2011, 08:14
Avatar de bUllan9ebrio  
Fecha de Ingreso: enero-2011
Ubicación: Chile
Mensajes: 1.128
Antigüedad: 13 años, 2 meses
Puntos: 128
Respuesta: Problemas con planillas de contacto

compa telefono lo estas enviando como digits y lo quieres rescatar como telf prueba cambiando eso y avisas que tal. suerte
  #4 (permalink)  
Antiguo 10/02/2011, 09:24
 
Fecha de Ingreso: julio-2005
Mensajes: 23
Antigüedad: 18 años, 9 meses
Puntos: 0
Respuesta: Problemas con planillas de contacto

Cuando trato de hacer envio, me dice lo siguiente:

Parse error: syntax error, unexpected '.' in /home/planific/public_html/sendmail.php on line 25


Los codigos nuevamente:

Código:
<?php

$mailto = "[email protected],[email protected]";
$messagesubject = "Email enviado desde la web";

$author = $_POST['author'];

$fromaddress = $_POST['email'];

if(isset($_POST['telf'])){
$telf = $_POST['telf'];
}else{$telf = "No coloco telefono";}

if(isset($_POST['ciudad'])){
$ciudad = $_POST['ciudad'];
}else{$ciudad = "No coloco ciudad";}

$body = $_POST['text'];

$message = 
$author." envio un email:\r\n Mensaje: ";
$email."\r\nTelefono: ";
$telf."\r\nCiudad: ";
$ciudad."\r\n\n\nMessage:\r\n<----BEGINNING OF MESSAGE!---->\r\n";
.$body."\r\n\n<----END OF MESSAGE!---->\r\n";

$eol = "\r\n";
$mime_boundary=md5(time());

  $headers .= 'From: '.$author.' .<'.$fromaddress.'>'.$eol;
  $headers .= 'Reply-To: '.$author.' .<'.$fromaddress.'>'.$eol;
  $headers .= 'Return-Path: '.$author.' .<'.$fromaddress.'>'.$eol;
  $headers .= "Message-ID: <".time()." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
  $headers .= "X-Mailer: PHP v".phpversion().$eol;
  $headers .= 'MIME-Version: 1.0'.$eol;
  $headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol;

$msg .= "Content-Type: multipart/alternative".$eol;
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= strip_tags(str_replace("<br>", "\n", $message)).$eol.$eol;
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= str_replace("\n", "<br>", $message).$eol.$eol;
$msg .= "--".$mime_boundary."--".$eol.$eol; 
ini_set(sendmail_from, $fromaddress);  // the INI lines are to force the From Address to be used !
$formsent = mail($mailto, $messagesubject, $msg, $headers);
ini_restore(sendmail_from);

if ($formsent) {
	echo "<fieldset style='background-color:#FFFFCC;'><legend>¡Gracias! ".$author."</legend><p>ya recibimos tu email, te contestaremos a la brevedad posible.</p></fieldset>";
	}else{
	echo "Hubo un problema con la planilla de contact, intenta de nuevo";
	}
?>


Código:
<form method="post" name="contact" id="contact_form"  class="leyenda" action="sendmail.php">
<div class="clear"><h2>Formulario de contacto</h2><br/></div>
<input type="hidden" name="post" value=" Send " />

<div class="float">
<label for="author">* Nombre:</label><br/>
<input type="text" id="author" name="author" class="required" />
</div>
<div class="float" style="clear:right">
<label for="email">* Correo electronico:</label><br/>
<input type="text" id="email" name="email" class="required email" />
</div>
<div class="float">
<label for="telf">Telefono de contacto:</label><br/>
<input type="text" name="telf" id="telf" class="digits" />
</div>
<div class="float">
<label for="ciudad">Ciudad / Localidad</label><br/>
<input type="text" name="ciudad" id="ciudad" /><br/><br/>
</div>
<div style="clear:both">
<label for="text">* Comentario:</label><br />
<textarea id="text" name="text" rows="6" cols="42" class="required"></textarea><br /><br />
<input type="submit" name="submitbutton" id="submitbutton" value=" Enviar " />
<div id="progress" style="display:none;">Enviando...</div>
</div>
</form>
  #5 (permalink)  
Antiguo 10/02/2011, 09:37
Avatar de bUllan9ebrio  
Fecha de Ingreso: enero-2011
Ubicación: Chile
Mensajes: 1.128
Antigüedad: 13 años, 2 meses
Puntos: 128
Respuesta: Problemas con planillas de contacto

Cambia esta linea:

Código PHP:
Ver original
  1. $body."\r\n\n<----END OF MESSAGE!---->\r\n";
  #6 (permalink)  
Antiguo 10/02/2011, 15:46
 
Fecha de Ingreso: julio-2005
Mensajes: 23
Antigüedad: 18 años, 9 meses
Puntos: 0
Respuesta: Problemas con planillas de contacto

Cita:
Iniciado por bUllan9ebrio Ver Mensaje
Cambia esta linea:

Código PHP:
Ver original
  1. $body."\r\n\n<----END OF MESSAGE!---->\r\n";
Y quer coloco?

Etiquetas: contacto, planillas
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:22.