<% @LCID = 1034%> .:Contacto:. || Sports Time México

Contacto

<% errNom = "" errMail = "" errTelefono = "" errCom = "" pro=request.QueryString("procesa") if pro = "si" then correcto = true nombre=request.Form("nombre") mail=request.Form("mail") tel=request.Form("tel") comentarios=request.Form("comentarios") if nombre = "" then errNom = "
Favor de escribir un nombre
" correcto = false end if if mail ="" or Validar_EMail(mail) = 1 then errMail = "
Favor de corregir su dirección de correo electrónico
" correcto = false end if if tel = "" then errTelefono = "
Favor de escribir un telefono
" correcto = false end if if comentarios = "" then errCom = "
Favor de escribir sus comentarios
" correcto = false end if if correcto = true then Dim DB, SQL, rs Set DB = Server.CreateObject("ADODB.Connection") Set rs = server.CreateObject("ADODB.recordset") DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + Server.MapPath("../db/_spmdb.mdb")) SQL = "select * from contacto" rs.open SQL,DB,3,3 rs.addnew rs("nombre")=nombre rs("mail")=mail rs("telefono")=tel rs("comentarios")=comentarios rs("fechahora")=now rs("status") = "A" rs.update Set objCDOMail = Server.CreateObject("CDONTS.NewMail") objCDOMail.From = "Webmaster " objCDOMail.To = "selenesg@sportstime.com.mx" objCDOMail.Subject = "Nuevo comentario" objCDOMail.Body = nombre & " ha ingresado un nuevo comentario. Para ver de que trata, ve a www.sportstime.com.mx/_dbViewer/comentarios.asp" objCDOMail.BodyFormat = 0 ' CdoMensajeFormatHTML objCDOMail.MailFormat = 0 ' Para que si lo mande en formato HTML objCDOMail.Send Set objCDOMail = Nothing response.Write("Gracias por enviar sus comentarios, dentro de poco nos pondremos en contacto con usted") end if end if %> <%=errNom%> <%=errMail%> <%=errTelefono%> <%=errCom%>
Nombre:
E-Mail:
Teléfono:
Comentarios:
<% if correcto <>true then%> <% end if%>


Copyright © 2005 Sports Time. Todos los derechos reservados. Este material no puede ser publicado, transmitido, re-escrito, o re-distribuido en ninguna forma.
Para cualquier duda o aclaración con respecto a esta página favor de contactar a: webmaster@sportstime.com.mx

<% 'Funcion que comprueba si un e-mail es valido. Devuelve: ' 0 -> si es nulo o esta vacio ' 1 -> Si el e-mail es incorrecto ' 2 -> Si el e-mail es valido Function Validar_EMail(EMail) Dim Con If EMail = "" Then Validar_EMail = 0 Exit Function End If EMail = LCase(EMail) If (Left(EMail, 1) = "." Or Left(EMail, 1) = "@") Then Validar_EMail = 1 Exit Function End If If (Right(EMail, 1) = "." Or Right(EMail, 1) = "_" Or _ Right(EMail, 1) = "@") Then Validar_EMail = 1 Exit Function End If Con = 0 For i = 1 To Len(EMail) If (Mid(EMail, i, 1)) = "@" Then Con = Con + 1 End If Next If Con > 1 Or Con = 0 Then Validar_EMail = 1 Exit Function End If Con = 0 For i = 1 To Len(EMail) If (Mid(EMail, i, 1)) = "@" Then For j = i To Len(EMail) If (Mid(EMail, j, 1)) = "." Then Con = Con + 1 End If Next End If Next If Con < 1 Then Validar_EMail = 1 Exit Function End If Con = 0 For i = 1 To Len(EMail) If (Mid(EMail, i, 1) = ".") Or (Mid(EMail, i, 1) = "@") Then If (Mid(EMail, i + 1, 1) = ".") Or (Mid(EMail, i + 1, 1) = "@") Then Validar_EMail = 1 Exit Function End If End If Next For i = 1 To Len(EMail) If (Mid(EMail, i, 1) < "a" Or Mid(EMail, i, 1) > "z") And _ (Mid(EMail, i, 1) < "0" Or Mid(EMail, i, 1) > "9") And _ Mid(EMail, i, 1) <> "." And Mid(EMail, i, 1) <> "_" And _ Mid(EMail, i, 1) <> "@" Then Validar_EMail = 1 Exit Function End If Next Validar_EMail = 2 End Function %>