Formulario de PHP no enviar al correo electrónico problema

  • sthebest
  • Born
  • Born
  • No Avatar
  • Registrado: Abr 02, 2008
  • Mensajes: 3
  • Status: Offline

Nota Febrero 10th, 2010, 2:42 pm

Hi all. im tratando de código de una forma simple para que la gente FLL si están interesados en reservar una reserva (de un sitio para su sitio un barco de la Carta). esto es lo que el código de la forma siguiente aspecto:

HTML Código: [ Select ]
<form action="gdform.asp" method="post">
<input type="hidden" name="subject" value="Form Submission" />
<input type="hidden" name="redirect" value="thanks.html" />
<input type="hidden" name="email" value="email address goes here" />
<p style="font-weight:bold;font-family:sans-serif;">Thank you for your interest in booking a reservation with KO Charters. We appreciate your patronage. Please
fill out the form below and a representative will get back to you as soon as possible.</p>
<p style="font-family:sans-serif;font-size:12px;">Email: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="TEXT" name="email"><br/>
<p style="font-family:sans-serif;font-size:12px;">First Name:&nbsp; <input type="TEXT" name="Firstname"><br/>
<p style="font-family:sans-serif;font-size:12px;">Last Name:&nbsp;&nbsp; <input type="TEXT" name="Lastname"><br/>
<p style="font-family:sans-serif;font-size:12px;">Address: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="address"><br/>
<p style="font-family:sans-serif;font-size:12px;">City: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="b.city"><br/>
<p style="font-family:sans-serif;font-size:12px;">State: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="c.state"><br/>
<p style="font-family:sans-serif;font-size:12px;">Zip Code: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="c.zip"><br/>
<p style="font-family:sans-serif;font-size:12px;">Telephone: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="phone"><br/>
<p style="font-family:sans-serif;font-size:12px;">Number of Passengers: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="no.passengers"><br/>
<p style="font-family:sans-serif;font-size:12px;">Charter Date: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="date"><br/>
<p style="font-family:sans-serif;font-size:12px;">Desired Package: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="package"><br/>
<p style="font-family:sans-serif;font-size:12px;">Desired Extras: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="extras"><br/>
<p style="font-size:9px;color:red;font-family:sans-serif;">*Your information will be kept confidential with KO Charters and
will never be sold or shared by third parties.</p>
<input type="submit" name="submit" value="submit"/>
  1. <form action="gdform.asp" method="post">
  2. <input type="hidden" name="subject" value="Form Submission" />
  3. <input type="hidden" name="redirect" value="thanks.html" />
  4. <input type="hidden" name="email" value="email address goes here" />
  5. <p style="font-weight:bold;font-family:sans-serif;">Thank you for your interest in booking a reservation with KO Charters. We appreciate your patronage. Please
  6. fill out the form below and a representative will get back to you as soon as possible.</p>
  7. <p style="font-family:sans-serif;font-size:12px;">Email: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="TEXT" name="email"><br/>
  8. <p style="font-family:sans-serif;font-size:12px;">First Name:&nbsp; <input type="TEXT" name="Firstname"><br/>
  9. <p style="font-family:sans-serif;font-size:12px;">Last Name:&nbsp;&nbsp; <input type="TEXT" name="Lastname"><br/>
  10. <p style="font-family:sans-serif;font-size:12px;">Address: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="address"><br/>
  11. <p style="font-family:sans-serif;font-size:12px;">City: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="b.city"><br/>
  12. <p style="font-family:sans-serif;font-size:12px;">State: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="c.state"><br/>
  13. <p style="font-family:sans-serif;font-size:12px;">Zip Code: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="c.zip"><br/>
  14. <p style="font-family:sans-serif;font-size:12px;">Telephone: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="phone"><br/>
  15. <p style="font-family:sans-serif;font-size:12px;">Number of Passengers: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="no.passengers"><br/>
  16. <p style="font-family:sans-serif;font-size:12px;">Charter Date: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="date"><br/>
  17. <p style="font-family:sans-serif;font-size:12px;">Desired Package: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="package"><br/>
  18. <p style="font-family:sans-serif;font-size:12px;">Desired Extras: &nbsp;&nbsp;&nbsp;<input type="TEXT" name="extras"><br/>
  19. <p style="font-size:9px;color:red;font-family:sans-serif;">*Your information will be kept confidential with KO Charters and
  20. will never be sold or shared by third parties.</p>
  21. <input type="submit" name="submit" value="submit"/>


¿Alguien puede decirme por qué no está enviando los resultados de la forma a una dirección de correo electrónico? Su ayuda será muy apreciada!
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Febrero 10th, 2010, 2:42 pm

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

Nota Febrero 10th, 2010, 3:59 pm

Bueno, el tema de tu post dice "la forma de PHP no enviar al correo electrónico problema", pero su acción en su forma es enviarlo a una secuencia de comandos ASP "<form action="gdform.asp" method="post">"

¿Cuál es? PHP o ASP?, y ¿cuál es su asp / código de script php?
"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.
  • sthebest
  • Born
  • Born
  • No Avatar
  • Registrado: Abr 02, 2008
  • Mensajes: 3
  • Status: Offline

Nota Febrero 12th, 2010, 2:40 pm

Bueno, la página en sí es un documento de PHP, pero soy un formulario ASP para enviar los resultados a una dirección de correo electrónico. debo cambiar el código para enviar a un PHP en su lugar (y en su lugar a su vez el script php en el servidor)?

Aquí está el código de secuencia de comandos ASP:

ASP Código: [ Select ]
<%
 
Dim landing_page, host_url
Dim fso, outfile, filename, dirname, myFolder
Dim req_method, key, value
Dim bErr, errStr, bEmpty
On Error resume next
bErr = false
bEmpty = true
errStr = ""
Set fso = Server.CreateObject("Scripting.FileSystemObject")
host_url = Request.ServerVariables("HTTP_HOST")
req_method = Request.ServerVariables("REQUEST_METHOD")
dtNow = Now()
filename = Server.MapPath("\ssfm")
dirname = filename
filename = filename & "\gdform_" & DatePart("M", dtNow) & DatePart("D", dtNow) & DatePart("YYYY", dtNow) & DatePart("N", dtNow) & DatePart("S", dtNow)
 
Function FormatVariableLine(byval var_name, byVal var_value)
   Dim tmpStr
   tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " START>" & vbCRLF
   tmpStr = tmpStr & var_value & vbCRLF
   tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " END>"
   FormatVariableLine = tmpStr
end function
 
Sub OutputLine(byVal line)
   outfile.WriteLine(line)
end sub
 
if err.number = 0 then
   Set outfile = fso.CreateTextFile(filename, true, false)
   if err.number <> 0 then
         bErr = true
         errStr = "Error creating file! Directory may not be writable or may not exist.<br>Unable to process request."
   else
      if(req_method = "GET") then
         for each Item in request.QueryString
            if item <> "" then
               bEmpty = false
               key = item
               value = Request.QueryString(item)
               if(lcase(key) = "redirect") then
                  landing_page = value
               else
                  line = FormatVariableLine(key, value)
                  Call OutputLine(line)
               end if
            end if   
         next
      elseif (req_method = "POST") then
         for each Item in request.form
            if item <> "" then
               bEmpty = false
               key = item
               value = Request.form(item)
               if(lcase(key) = "redirect") then
                  landing_page = value
               else
                  line = FormatVariableLine(key, value)
                  Call OutputLine(line)
               end if
            end if   
         next
      end if
      outfile.close
   end if  
   if(bEmpty = true) AND errStr = "" then
      bErr = true
      errStr = errStr & "<br>No variables sent to form! Unable to process request."
   end if
   if(bErr = false) then   
      if (landing_page <> "") then
         response.Redirect "http://" & host_url & "/" & landing_page
      else
         response.Redirect "http://" & host_url
      end if
   else
      Response.Write errStr
   end if  
   set fso = nothing
else
  Response.Write " An Error Occurred creating mail message. Unable to process form request at this time."
end if
%>
  1. <%
  2.  
  3. Dim landing_page, host_url
  4. Dim fso, outfile, filename, dirname, myFolder
  5. Dim req_method, key, value
  6. Dim bErr, errStr, bEmpty
  7. On Error resume next
  8. bErr = false
  9. bEmpty = true
  10. errStr = ""
  11. Set fso = Server.CreateObject("Scripting.FileSystemObject")
  12. host_url = Request.ServerVariables("HTTP_HOST")
  13. req_method = Request.ServerVariables("REQUEST_METHOD")
  14. dtNow = Now()
  15. filename = Server.MapPath("\ssfm")
  16. dirname = filename
  17. filename = filename & "\gdform_" & DatePart("M", dtNow) & DatePart("D", dtNow) & DatePart("YYYY", dtNow) & DatePart("N", dtNow) & DatePart("S", dtNow)
  18.  
  19. Function FormatVariableLine(byval var_name, byVal var_value)
  20.    Dim tmpStr
  21.    tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " START>" & vbCRLF
  22.    tmpStr = tmpStr & var_value & vbCRLF
  23.    tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " END>"
  24.    FormatVariableLine = tmpStr
  25. end function
  26.  
  27. Sub OutputLine(byVal line)
  28.    outfile.WriteLine(line)
  29. end sub
  30.  
  31. if err.number = 0 then
  32.    Set outfile = fso.CreateTextFile(filename, true, false)
  33.    if err.number <> 0 then
  34.          bErr = true
  35.          errStr = "Error creating file! Directory may not be writable or may not exist.<br>Unable to process request."
  36.    else
  37.       if(req_method = "GET") then
  38.          for each Item in request.QueryString
  39.             if item <> "" then
  40.                bEmpty = false
  41.                key = item
  42.                value = Request.QueryString(item)
  43.                if(lcase(key) = "redirect") then
  44.                   landing_page = value
  45.                else
  46.                   line = FormatVariableLine(key, value)
  47.                   Call OutputLine(line)
  48.                end if
  49.             end if   
  50.          next
  51.       elseif (req_method = "POST") then
  52.          for each Item in request.form
  53.             if item <> "" then
  54.                bEmpty = false
  55.                key = item
  56.                value = Request.form(item)
  57.                if(lcase(key) = "redirect") then
  58.                   landing_page = value
  59.                else
  60.                   line = FormatVariableLine(key, value)
  61.                   Call OutputLine(line)
  62.                end if
  63.             end if   
  64.          next
  65.       end if
  66.       outfile.close
  67.    end if  
  68.    if(bEmpty = true) AND errStr = "" then
  69.       bErr = true
  70.       errStr = errStr & "<br>No variables sent to form! Unable to process request."
  71.    end if
  72.    if(bErr = false) then   
  73.       if (landing_page <> "") then
  74.          response.Redirect "http://" & host_url & "/" & landing_page
  75.       else
  76.          response.Redirect "http://" & host_url
  77.       end if
  78.    else
  79.       Response.Write errStr
  80.    end if  
  81.    set fso = nothing
  82. else
  83.   Response.Write " An Error Occurred creating mail message. Unable to process form request at this time."
  84. end if
  85. %>



Perdóname por hacer tantas preguntas, pero soy un diseñador gráfico por naturaleza, que casualmente pasa a hacer un poco de diseño de páginas web.

Publicar Información

  • Total de mensajes en este tema: 3 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 110 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