Ayuda! Problemas con el correo un formulario script en php y html....

  • mlisubaru
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Jul 18, 2003
  • Mensajes: 5
  • Status: Offline

Nota Julio 18th, 2003, 8:34 am

Im tratando de hacer una forma simple correo electrónico, pero Im con un tiempo muy duro con él. ¿Alguien mente mirando por encima del guión? Lo tengo en dos partes: un archivo HTML y un script PHP.

html:

Código: [ Select ]
<form method="post" action="email.php" name="billform">
<input type="hidden" name="to" value="mchild2@osa.org">
<input type="hidden" name="subject" value="High-speed Internet Access Billing">
First Name:
<input name="firstname" type="text" size="30">
<br>
Last Name:
<input name="lastname" type="text" size="30">
<br>
Room #:
<input name="roomno" type="text" size="5">
<br>
I wish to purchase
<input name="days" type="text" size="5">
days of internet access.<br>
<input type="submit" name="Submit" value="I Authorize Billing">
&
<input type="reset" name="Clear" value="Clear">
</font></p>
</form>
  1. <form method="post" action="email.php" name="billform">
  2. <input type="hidden" name="to" value="mchild2@osa.org">
  3. <input type="hidden" name="subject" value="High-speed Internet Access Billing">
  4. First Name:
  5. <input name="firstname" type="text" size="30">
  6. <br>
  7. Last Name:
  8. <input name="lastname" type="text" size="30">
  9. <br>
  10. Room #:
  11. <input name="roomno" type="text" size="5">
  12. <br>
  13. I wish to purchase
  14. <input name="days" type="text" size="5">
  15. days of internet access.<br>
  16. <input type="submit" name="Submit" value="I Authorize Billing">
  17. &
  18. <input type="reset" name="Clear" value="Clear">
  19. </font></p>
  20. </form>



El PHP doc (en su totalidad):

Código: [ Select ]
<?php

$msg = array($firstname, $lastname, $roomno, $days);
$firstname = 'firstname';
$lastname = 'lastname';
$roomno = 'roomno';
$days = 'days';

$mailheaders = "$REMOTE_ADDR\n";

mail($name, $email, join("\n", $msg), $mailheaders);

?>
<html>
<head>
<title> Thank you </title>
<style type="text/css">
#main
{position: absolute;
top: 200px;
left: 325px;
width:450 px;
}
</style>
<script language="JavaScript"><!--
setTimeout("top.location.href = 'http://www.yahoo.com'",0);
//--></script>
</head>
<body>
<div id="main">
Thank you for your submission. If you are not redirected, please <a href=http://www.yahoo.com">click here</a>.
</div>
</body>
  1. <?php
  2. $msg = array($firstname, $lastname, $roomno, $days);
  3. $firstname = 'firstname';
  4. $lastname = 'lastname';
  5. $roomno = 'roomno';
  6. $days = 'days';
  7. $mailheaders = "$REMOTE_ADDR\n";
  8. mail($name, $email, join("\n", $msg), $mailheaders);
  9. ?>
  10. <html>
  11. <head>
  12. <title> Thank you </title>
  13. <style type="text/css">
  14. #main
  15. {position: absolute;
  16. top: 200px;
  17. left: 325px;
  18. width:450 px;
  19. }
  20. </style>
  21. <script language="JavaScript"><!--
  22. setTimeout("top.location.href = 'http://www.yahoo.com'",0);
  23. //--></script>
  24. </head>
  25. <body>
  26. <div id="main">
  27. Thank you for your submission. If you are not redirected, please <a href=http://www.yahoo.com">click here</a>.
  28. </div>
  29. </body>


Cuando llene el formulario y haga clic en enviar, me manda a la "gracias" la página que redirige a mí, pero nunca recibirá un correo electrónico. ¿Puede alguien ayudarme?
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Julio 18th, 2003, 8:34 am

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • Avatar de Usuario
  • Registrado: May 28, 2003
  • Mensajes: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Nota Julio 18th, 2003, 8:57 am

Ive nunca visto el destinatario aparece como "a" en cualquier otro idioma.

Ejemplo de la secuencia de comandos: #058;
Código: [ Select ]
<input type="hidden" name="to" value="mchild2@osa.org">

Pruebe a cambiar a:
Código: [ Select ]
<input type="hidden" name="recipient" value="mchild2@osa.org">

y ver si funciona.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • b_heyer
  • Web Master
  • Web Master
  • Avatar de Usuario
  • Registrado: Jun 15, 2003
  • Mensajes: 4583
  • Loc: Maryland
  • Status: Offline

Nota Julio 18th, 2003, 9:21 am

"a" es la variable utilizada para llamar a los beneficiarios más tarde...

Código: [ Select ]
mail($name, $email, join("\n", $msg), $mailheaders);


Usted parece tener las variables más mezclado, más no veo donde $ nombre se define, probablemente debería ser de $ a. Esto funciona:
Código: [ Select ]
mail (
"$to",
"$subject",
"Name: $firstname" . " $lastname," . "Room #: $roomno" . "Days Ordered: $days",
"From: $email"
);

//I am unsure what any of this is:

$firstname = 'firstname';
$lastname = 'lastname';
$roomno = 'roomno';
$days = 'days';

//because I don't see it called anywhere in the script.
  1. mail (
  2. "$to",
  3. "$subject",
  4. "Name: $firstname" . " $lastname," . "Room #: $roomno" . "Days Ordered: $days",
  5. "From: $email"
  6. );
  7. //I am unsure what any of this is:
  8. $firstname = 'firstname';
  9. $lastname = 'lastname';
  10. $roomno = 'roomno';
  11. $days = 'days';
  12. //because I don't see it called anywhere in the script.


Incluí una From: $ correo electrónico, que no es necissary.

Esta es la página del manual de PHP mail ();
Quote:
bool mail (string para, string asunto, string mensaje [, string [, string]]),


Tal vez eso podría ayudar. Y la realidad página:
http://www.php.net/manual/en/function.mail.php
Pixel Acres V2
  • mlisubaru
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Jul 18, 2003
  • Mensajes: 5
  • Status: Offline

Nota Julio 18th, 2003, 9:49 am

Que parece funcionar, excepto el correo electrónico no me da los datos, simplemente

"Nombre: Apellido Nombre, Sala #: RoomnoDays Z: días "

html:
Código: [ Select ]
<form method="post" action="email.php" name="billform">
<input type="hidden" name="to" value="mchild2@osa.org">
<input type="hidden" name="subject" value="High-speed Internet Access Billing">
    First Name: 
     <input name="firstname" type="text" size="30">
     <br>
    Last Name:
    <input name="lastname" type="text" size="30">
     <br>
    Room #:
    <input name="roomno" type="text" size="5">
     <br>
    I wish to purchase
    <input name="days" type="text" size="5">
days of internet access.
<br>
    <input type="submit" name="Submit" value="I Authorize Billing"> 
    &
    <input type="reset" name="Clear" value="Clear">
</font></p>
   </form>
  1. <form method="post" action="email.php" name="billform">
  2. <input type="hidden" name="to" value="mchild2@osa.org">
  3. <input type="hidden" name="subject" value="High-speed Internet Access Billing">
  4.     First Name: 
  5.      <input name="firstname" type="text" size="30">
  6.      <br>
  7.     Last Name:
  8.     <input name="lastname" type="text" size="30">
  9.      <br>
  10.     Room #:
  11.     <input name="roomno" type="text" size="5">
  12.      <br>
  13.     I wish to purchase
  14.     <input name="days" type="text" size="5">
  15. days of internet access.
  16. <br>
  17.     <input type="submit" name="Submit" value="I Authorize Billing"> 
  18.     &
  19.     <input type="reset" name="Clear" value="Clear">
  20. </font></p>
  21.    </form>


PHP:
Código: [ Select ]
<?php

$msg = array($firstname, $lastname, $roomno, $days);
$firstname = 'firstname';
$lastname = 'lastname';
$roomno = 'roomno';
$days = 'days';

$mailheaders = "$REMOTE_ADDR\n";

mail (
"$to",
"$subject",
"Name: $firstname" . " $lastname," . "Room #: $roomno" . "Days Ordered: $days"
); 

?>
  1. <?php
  2. $msg = array($firstname, $lastname, $roomno, $days);
  3. $firstname = 'firstname';
  4. $lastname = 'lastname';
  5. $roomno = 'roomno';
  6. $days = 'days';
  7. $mailheaders = "$REMOTE_ADDR\n";
  8. mail (
  9. "$to",
  10. "$subject",
  11. "Name: $firstname" . " $lastname," . "Room #: $roomno" . "Days Ordered: $days"
  12. ); 
  13. ?>


¿Alguna idea? Gracias tan por su ayuda !!![/ code]
  • mlisubaru
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Jul 18, 2003
  • Mensajes: 5
  • Status: Offline

Nota Julio 18th, 2003, 10:24 am

LoL No importa! Me imaginé que fuera! Funciona perfectamente. Muchísimas gracias!
  • b_heyer
  • Web Master
  • Web Master
  • Avatar de Usuario
  • Registrado: Jun 15, 2003
  • Mensajes: 4583
  • Loc: Maryland
  • Status: Offline

Nota Julio 18th, 2003, 10:47 am

Sí, como he dicho, no sé por qué se la definición de las variables....
Pixel Acres V2
  • mlisubaru
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Jul 18, 2003
  • Mensajes: 5
  • Status: Offline

Nota Julio 18th, 2003, 1:28 pm

Gah. Pensé que era todo liso. Im haber un problema más. con este...Por la razón que sea los datos que enviará a algunas cuentas de correo electrónico, pero no otros. He intentado enviarlo a 4, ya la salida de los 4, 2 funcionó perfectamente y los otros 2 no a todos. Cualquier persona que nunca antes de esta experiencia? ¿Qué debo hacer?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • Avatar de Usuario
  • Registrado: Dic 20, 2002
  • Mensajes: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Nota Julio 18th, 2003, 1:35 pm

¿Recibes algún error? Para el 2 de que no ha funcionado es usted capaz de enviar un e-mail a aquellos? ¿Hay alguna diferencia entre las cuentas de correo electrónico que el trabajo frente a las cuentas de correo electrónico que no funciona?
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • mlisubaru
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Jul 18, 2003
  • Mensajes: 5
  • Status: Offline

Nota Julio 18th, 2003, 1:40 pm

Im no recibir ningún tipo de errores.... Todavía va a la "página de agradecimiento" y remite a la página principal, pero la dirección de correo electrónico nunca pasa por (el 2 disfunctional). Todos los mensajes de correo electrónico se encontraban en distintos ámbitos (que son oficiales - empresa e-mails). Acabo probado en yahoo, y lo hace trabajar allí, por lo que Im realmente perplejo acerca de ¿Qué piensas. Esto es realmente extraño! Ah, y muchas gracias por ayudarme!
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • Avatar de Usuario
  • Registrado: Dic 20, 2002
  • Mensajes: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Nota Julio 18th, 2003, 1:56 pm

¡A mí me suena como su guión está trabajando muy bien, y podría ser un mensaje de correo electrónico en cuestión el resto de tus servidores? Intente enviar un correo electrónico (no a través de su forma que es) a los 2 mensajes de correo electrónico que no funcionan y ver si ellos que reciben.
Ozzu Hosting - Want your website on a fast server like Ozzu?

Publicar Información

  • Total de mensajes en este tema: 10 mensajes
  • Usuarios navegando por este Foro: Kurthead+1 y 130 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC