elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


  Mostrar Temas
Páginas: [1]
1  Programación / PHP / script de contacto... no envia emails... en: 26 Mayo 2007, 22:13 pm
hola que tal...

miren tengo este script. (lo tengo alojado en 100webspace) pero no me envia los emails...

mailer.php
<form method="POST" action="enviado.php">

<
head>
<
title>xxx</title>
<
style type="text/css">
<!--
body {
background-color:#FFFFFF
}
td {
background-color:#FFFFFF;
}

inputselecttextarea {
background-color#FFFFCC;
border#009900 1px solid;
font-size:10px
}

a:linka:visited {
color:#FFFFFF;
font-weight:bold;
text-decorationnone;
}

a:hover {
text-decoration:underline;
}

-->
</
style>
</
head>

<
body bgcolor="fff">

<
p><b><font style="font-size:12px; font-family:Arial, Helvetica, sans-serif">&#9658; Ponte en Contacto con tu Presidente.</font></b></p>
                                      
<div align="center">
                                        <
center>
                                      <
table border="0" width="400px" cellspacing="0" cellpadding="0" height="223">
                                        <
tr>
                                          <
td width="100%" bgcolor="fff" height="223">
                                            <
table border="0" width="100%" cellspacing="1" cellpadding="0" height="103">
                                              <
tr>
                                                <
td width="28%" bgcolor="#fff" height="25">
                                                <
p align="right"><font style=" font-size:12px;font-family:Arial, Helvetica, sans-serif">Nombre:&nbsp;&nbsp;</font></td>
                                                <
td width="72%" bgcolor="#fff" height="25">&nbsp;<input type="text" name="nombre" size="60"></td>
                                              </
tr>
                                              <
tr>
                                                <
td width="28%" bgcolor="#fff" height="25">
                                                <
p align="right"><font style=" font-size:12px;font-family:Arial, Helvetica, sans-serif">E-mail:&nbsp;&nbsp;</font></td>
                                                <
td width="72%" bgcolor="#fff" height="25">&nbsp;<input type="text" name="email" size="60" ></td>
                                              </
tr>
                                              <
tr>
                                                <
td width="28%" bgcolor="#fff" height="25">
                                                  <
p align="right"><font style=" font-size:12px;font-family:Arial, Helvetica, sans-serif">Direccion:&nbsp;&nbsp;</font></td>
                                                <
td width="72%" bgcolor="#fff" height="25">&nbsp;<input type="text" name="direccion" size="60"></td>
                                              </
tr>
                                              <
tr>
                                                <
td width="28%" bgcolor="#fff" height="25">
                                                <
p align="right"><font style=" font-size:12px;font-family:Arial, Helvetica, sans-serif">Telefono:&nbsp;&nbsp;</font></td>
                                                <
td width="72%" bgcolor="#fff" height="25">&nbsp;<input type="text" name="telefono" size="60" ></td>
                                              </
tr>
                                              <
tr>
                                                <
td width="28%" bgcolor="#fff" height="25">
                                                <
p align="right"><font style=" font-size:12px;font-family:Arial, Helvetica, sans-serif">Ciudad:&nbsp;&nbsp;</font></td>
                                                <
td width="72%" bgcolor="#fff" height="25">&nbsp;<input type="text" name="ciudad" size="60" ></td>
                                              </
tr>
                                              <
tr>
                                                <
td width="28%" bgcolor="#fff" height="25">
                                                <
p align="right"><font style=" font-size:12px;font-family:Arial, Helvetica, sans-serif">Estado:&nbsp;&nbsp;</font></td>
                                                <
td width="72%" bgcolor="#fff" height="25">&nbsp;<input type="text" name="estado" size="60" ></td>
                                              </
tr>
                                              <
tr>
                                                <
td width="28%" bgcolor="#fff" height="25">
                                                <
p align="right"><font style=" font-size:12px;font-family:Arial, Helvetica, sans-serif">Asunto:&nbsp;&nbsp;</font></td>
                                                <
td width="72%" bgcolor="#fff" height="25">&nbsp;
                                                  <
select size="1" name="asunto" >
                                                    <
option selected>Seleccione</option>
                                                    <
option>Peticiones</option>
                                                    <
option>Quejas</option>
                                                    <
option>Sugerencias</option>
                                                    <
option>Otros..</option>
                                                </
select></td>
                                              </
tr>
                                              <
tr>
                                                <
td width="28%" bgcolor="#fff" height="56">
                                                <
p align="right"><font style=" font-size:12px;font-family:Arial, Helvetica, sans-serif">Mensaje:&nbsp;&nbsp;</font></td>
                                                <
td width="72%" bgcolor="#fff" height="56">&nbsp;<textarea rows="10" name="mensaje" cols="55" ></textarea></td>
                                              </
tr>
                                              <
tr>
                                                <
td width="28%" bgcolor="#fff" height="43">&nbsp;</td>
                                                <
td width="72%" bgcolor="#fff" height="43">&nbsp;<input type="submit" value="Enviar" name="enviar">
                                                  <
input type="reset" value="Borrar" name="borrar"></td>
                                              </
tr>
                                            </
table>
                                          </
td>
                                        </
tr>
                                      </
table>
                                        </
center>
                                      </
div>
                                    </
form>


enviado.php
<?php

//E-mail en donde se recibirá el Formulario.

$recipiente "xxx@xxx.com";

//URL de tu Sitio Web.

$sw "http://www.xxx.org/";

//Mensaje que te llegará al Correo, con los datos ingresados.

$msg "El Sr/Sra $nombre, se desea poner en contacto con usted, y envia el siguiente mensaje con los siguientes datos:\n\n\n

   Nombre: 
$nombre
    Email: 
$email
Direccion: 
$direccion
 Telefono: 
$telefono
   Ciudad: 
$ciudad
   Estado: 
$estado
   Asunto: 
$asunto
  Mensaje: 
$mensaje\n\n";

//Comprobamos que los campos del formulario se encuentren completos.

if (empty($nombre)){
echo 
"<p align=center><font face=tahoma size=2><b><font color=#FF0000>Error:</font> No has
ingresado tu Nombre.</b></font></p>"
;
}
if(empty(
$email)){
echo 
"<p align=center><font face=tahoma size=2><b><font color=#FF0000>Error:</font> No has
ingresado tu E-mail.</b></font></p>"
;
}
if(empty(
$direccion)){
echo 
"<p align=center><font face=tahoma size=2><b><font color=#FF0000>Error:</font> No has
seleccionado una direccion.</b></font></p>"
;

if(empty(
$telefono)){
echo 
"<p align=center><font face=tahoma size=2><b><font color=#FF0000>Error:</font> No has
seleccionado un telefono.</b></font></p>"
;

if(empty(
$ciudad)){
echo 
"<p align=center><font face=tahoma size=2><b><font color=#FF0000>Error:</font> No has
seleccionado una ciudad.</b></font></p>"
;

if(empty(
$estado)){
echo 
"<p align=center><font face=tahoma size=2><b><font color=#FF0000>Error:</font> No has
seleccionado un estado.</b></font></p>"
;

if(empty(
$asunto)){
echo 
"<p align=center><font face=tahoma size=2><b><font color=#FF0000>Error:</font> No has
seleccionado un Asunto.</b></font></p>"
;

if(empty(
$mensaje)){
echo 
"<p align=center><font face=tahoma size=2><b><font color=#FF0000>Error:</font> No has
ingresado el Mensaje.</b></font></p>"
;
}else{

//Limpiamos de posibles ataques.

$mensaje ereg_replace("\r\n","<br>"$mensaje);

$nombre htmlentities($nombre);
$email htmlentities($email);
$direccion htmlentities($direccion);
$telefono htmlentities($telefono);
$ciudad htmlentities($ciudad);
$estado htmlentities($estado);
$asunto htmlentities($asunto);
$mensaje htmlentities($mensaje);

//Enviamos el E-mail con todos los datos.

mail("$recipiente""$asunto""$msg""FROM: $email");

//Damos las gracias al visitante por contactarnos.

echo"<font face=tahoma size=2>
<p align=center>Gracias <b>
$nombre</b>. 
<p align=center>Tu Mensaje ha sido enviado con exito!<br>
En unos instantes mas el xxx, tendra en sus manos el comentario para ofrecerte una respuesta.<br>
<br>
<b>G r a c i a s !</b><br>
<br>
<br>
</p>
<p align=center><br>
<a href='http://www.xxx.org/' target='_top'>Regresar a la Pagina Principal</a>.</p>"
;
}
?>

no entiendo por que no me envia los emails... me dijeron esto hace un tiempo

Citar
Hola, el formulario lo estás enviando por POST, deberías recojer los valores así antes (no hago control de errores, ni de si las variables contienen algo):

Código:

$nombre = $_POST["nombre"];
$email = $_POST["email"];
$direccion = $_POST["direccion"];
// y así con todas las variables enviadas por POST


pero no entiendo a que se refiere ni como hacerlo. me pueden ayudar? porfavor urge
2  Media / Juegos y Consolas / Como crear una red Hamachi para jugar Counter Strike 1.6 ? en: 10 Noviembre 2006, 15:30 pm
alguin sabe o conoce un buen tutorial para crear una red hamachi para jugar counter strike 1.6 ?
3  Media / Juegos y Consolas / Descarga Half-Life 100% funcionando en: 2 Noviembre 2006, 02:53 am
http://rapidshare.com/files/1568530/Half_Life.part1.rar
http://rapidshare.com/files/1563931/Half_Life.part2.rar

descarguen y disfruten este jueog se lo recomiendo a los que no tienen un pc muy potente , va de lujo!

[SIZE="4"]Sientanse libres de publicar estos enlaces en sus webs blogs o lo que gusten...[/SIZE][/I][/B]
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines