Formulario de PHP no enviar al correo electrónico problema
- sthebest
- Born


- Registrado: Abr 02, 2008
- Mensajes: 3
- Status: Offline
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:
¿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!
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: <input type="TEXT" name="email"><br/>
<p style="font-family:sans-serif;font-size:12px;">First Name: <input type="TEXT" name="Firstname"><br/>
<p style="font-family:sans-serif;font-size:12px;">Last Name: <input type="TEXT" name="Lastname"><br/>
<p style="font-family:sans-serif;font-size:12px;">Address: <input type="TEXT" name="address"><br/>
<p style="font-family:sans-serif;font-size:12px;">City: <input type="TEXT" name="b.city"><br/>
<p style="font-family:sans-serif;font-size:12px;">State: <input type="TEXT" name="c.state"><br/>
<p style="font-family:sans-serif;font-size:12px;">Zip Code: <input type="TEXT" name="c.zip"><br/>
<p style="font-family:sans-serif;font-size:12px;">Telephone: <input type="TEXT" name="phone"><br/>
<p style="font-family:sans-serif;font-size:12px;">Number of Passengers: <input type="TEXT" name="no.passengers"><br/>
<p style="font-family:sans-serif;font-size:12px;">Charter Date: <input type="TEXT" name="date"><br/>
<p style="font-family:sans-serif;font-size:12px;">Desired Package: <input type="TEXT" name="package"><br/>
<p style="font-family:sans-serif;font-size:12px;">Desired Extras: <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"/>
<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: <input type="TEXT" name="email"><br/>
<p style="font-family:sans-serif;font-size:12px;">First Name: <input type="TEXT" name="Firstname"><br/>
<p style="font-family:sans-serif;font-size:12px;">Last Name: <input type="TEXT" name="Lastname"><br/>
<p style="font-family:sans-serif;font-size:12px;">Address: <input type="TEXT" name="address"><br/>
<p style="font-family:sans-serif;font-size:12px;">City: <input type="TEXT" name="b.city"><br/>
<p style="font-family:sans-serif;font-size:12px;">State: <input type="TEXT" name="c.state"><br/>
<p style="font-family:sans-serif;font-size:12px;">Zip Code: <input type="TEXT" name="c.zip"><br/>
<p style="font-family:sans-serif;font-size:12px;">Telephone: <input type="TEXT" name="phone"><br/>
<p style="font-family:sans-serif;font-size:12px;">Number of Passengers: <input type="TEXT" name="no.passengers"><br/>
<p style="font-family:sans-serif;font-size:12px;">Charter Date: <input type="TEXT" name="date"><br/>
<p style="font-family:sans-serif;font-size:12px;">Desired Package: <input type="TEXT" name="package"><br/>
<p style="font-family:sans-serif;font-size:12px;">Desired Extras: <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"/>
- <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: <input type="TEXT" name="email"><br/>
- <p style="font-family:sans-serif;font-size:12px;">First Name: <input type="TEXT" name="Firstname"><br/>
- <p style="font-family:sans-serif;font-size:12px;">Last Name: <input type="TEXT" name="Lastname"><br/>
- <p style="font-family:sans-serif;font-size:12px;">Address: <input type="TEXT" name="address"><br/>
- <p style="font-family:sans-serif;font-size:12px;">City: <input type="TEXT" name="b.city"><br/>
- <p style="font-family:sans-serif;font-size:12px;">State: <input type="TEXT" name="c.state"><br/>
- <p style="font-family:sans-serif;font-size:12px;">Zip Code: <input type="TEXT" name="c.zip"><br/>
- <p style="font-family:sans-serif;font-size:12px;">Telephone: <input type="TEXT" name="phone"><br/>
- <p style="font-family:sans-serif;font-size:12px;">Number of Passengers: <input type="TEXT" name="no.passengers"><br/>
- <p style="font-family:sans-serif;font-size:12px;">Charter Date: <input type="TEXT" name="date"><br/>
- <p style="font-family:sans-serif;font-size:12px;">Desired Package: <input type="TEXT" name="package"><br/>
- <p style="font-family:sans-serif;font-size:12px;">Desired Extras: <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"/>
¿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


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Febrero 10th, 2010, 2:42 pm
- ATNO/TW
- Super Moderator


- Registrado: May 28, 2003
- Mensajes: 23407
- Loc: Woodbridge VA
- Status: Offline
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?
¿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.
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


- Registrado: Abr 02, 2008
- Mensajes: 3
- Status: Offline
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:
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.
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
%>
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
%>
- <%
- 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
- %>
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.
Página 1 de 1
Para responder a este tema que necesita para ingresar o registrarse. Es gratis.
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
