Visualizzazione dei risultati da 1 a 7 su 7
  1. #1

    Interrogazione DB con CDONTS html

    Ciao a tutti...
    partendo dal presupposto che sono un0ignorante assoluto in ASP (ho appena iniziato) mi trovo davanti ad un problema.

    Ho un form di recupero password... digito il mio indirizzo mail e teoricamente mi dovrebbe mandare la password relativa a quell'indirizzo al momento dell'iscrizione.

    Il problema è che ho messo la formattazione della mail in HTML e non so tramite quale comando interrogare il database in modo che mi riporti scritta quella determinata password...

    Allego il codice della mia paginetta.. mi ci sto picchiando da un giorno e passa e nn ho ancora trovato il modo di farmi inviare quella password..!!!

    --------------------------------------------------------------------

    <%
    Dim Recordset1__var
    Recordset1__var = "1"
    If (Request("email") <> "") Then
    Recordset1__var = Request("email")
    End If
    %>
    <%
    Dim Recordset1
    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_xxxxxxxxxxxxx_STRING
    Recordset1.Source = "SELECT nome, cognome, username, password, email FROM clienti WHERE email LIKE '" + Replace(Recordset1__var, "'", "''") + "'"
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 1
    Recordset1.Open()

    Recordset1_numRows = 0
    %>
    <% If (Recordset1.EOF) Then %>
    <% Response.Redirect "vuoto.asp" %>
    <% end if %>
    <% if (cStr(Request("Submit")) <> "") Then
    Dim objMail
    Set objMail = CreateObject("CDONTS.NewMail")
    HTML = HTML & "<html>"
    HTML = HTML & "<head>"
    HTML = HTML & "<meta http-equiv=Content-Type content=text/html; charset=iso-8859-1>"
    HTML = HTML & "<link href=http://www.xxxxxxxxx.com/xxxxx/xxxxxx rel=stylesheet type=text/css>"
    HTML = HTML & "</head>"
    HTML = HTML & "<body bgcolor=#efece5 leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"
    HTML = HTML & "<img src= http://www.xxxxx.com/xxxx/xxxx.jpg width=720 height=123>
    "
    HTML = HTML & "<p class=links> La tua registrazione &egrave; avvenuta correttamente!</p>"
    HTML = HTML & "<p span class=testi> Ricorda, la tua Password &egrave;:</span>"
    HTML = HTML & "<span class=linksROSSI>"
    HTML = HTML & Request("password")
    HTML = HTML & "<p class=titoli> Il Sarca E-Store ti ringrazia"
    HTML = HTML & "</body>"
    HTML = HTML & "</html>"
    objMail.From = "xxxx@xxxx.it" ' Mittente - indirizzo del negozio
    objMail.To = Request("Email") ' Destinatario - indirizzo del cliente
    objMail.BCC = "" 'Copia Carbone nascosta - indirizzo del negozio, per conoscenza
    objMail.Subject = "Nuova Registrazione"'oggetto
    objMail.BodyFormat = 0
    objMail.MailFormat = 0
    objMail.Body = HTML

    objMail.Send() 'send mail
    Set objMail = Nothing 'chiude e libera le risorse
    Response.Redirect("grazie2.asp")
    End If
    %>

    <%
    Recordset1.Close()
    Set Recordset1 = Nothing
    %>

    -------------------------------------------------------------------

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
    <% 
    Dim Recordset1__var 
    Recordset1__var = "1" 
    If (Request("email") <> "") Then 
    Recordset1__var = Request("email") 
    End If 
    %> 
    <% 
    Dim Recordset1 
    Dim Recordset1_numRows 
    
    Set Recordset1 = Server.CreateObject("ADODB.Recordset") 
    Recordset1.ActiveConnection = MM_xxxxxxxxxxxxx_STRING 
    Recordset1.Source = "SELECT nome, cognome, username, password, email FROM clienti WHERE email LIKE '" + Replace(Recordset1__var, "'", "''") + "'" 
    Recordset1.CursorType = 0 
    Recordset1.CursorLocation = 2 
    Recordset1.LockType = 1 
    Recordset1.Open() 
    
    Recordset1_numRows = 0 
    %> 
    <% If (Recordset1.EOF) Then %> 
    <% Response.Redirect "vuoto.asp" %> 
    <% end if %> 
    <% if (cStr(Request("Submit")) <> "") Then
    password = Recordset1("password")   
    Dim objMail 
    Set objMail = CreateObject("CDONTS.NewMail") 
    HTML = HTML & "<html>" 
    HTML = HTML & "<head>" 
    HTML = HTML & "<meta http-equiv=Content-Type content=text/html; charset=iso-8859-1>" 
    HTML = HTML & "<link href=http://www.xxxxxxxxx.com/xxxxx/xxxxxx rel=stylesheet type=text/css>" 
    HTML = HTML & "</head>" 
    HTML = HTML & "<body bgcolor=#efece5 leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>" 
    HTML = HTML & "<img src= http://www.xxxxx.com/xxxx/xxxx.jpg width=720 height=123>
    " 
    HTML = HTML & "<p class=links>   La tua registrazione è avvenuta correttamente!</p>" 
    HTML = HTML & "<p span class=testi>   Ricorda, la tua Password è:  </span>" 
    HTML = HTML & "<span class=linksROSSI>" 
    HTML = HTML & password 
    HTML = HTML & "<p class=titoli>   Il Sarca E-Store ti ringrazia" 
    HTML = HTML & "</body>" 
    HTML = HTML & "</html>" 
    objMail.From = "xxxx@xxxx.it" ' Mittente - indirizzo del negozio 
    objMail.To = Request("Email") ' Destinatario - indirizzo del cliente 
    objMail.BCC = "" 'Copia Carbone nascosta - indirizzo del negozio, per conoscenza 
    objMail.Subject = "Nuova Registrazione"'oggetto 
    objMail.BodyFormat = 0 
    objMail.MailFormat = 0 
    objMail.Body = HTML 
    
    objMail.Send() 'send mail 
    Set objMail = Nothing 'chiude e libera le risorse 
    Response.Redirect("grazie2.asp") 
    End If 
    %> 
    
    <% 
    Recordset1.Close() 
    Set Recordset1 = Nothing 
    %>
    Roby

  3. #3
    MA TI VOGLIO VERAMENTE BENEEEEE!!! !

    anche se lo provo domani, dandoci un'occhiata ho già capito...
    ...che sono tonto... VVoVe:

  4. #4
    hem... ho cantato vittoria troppo presto.

    Non funziona.

    Invia la mail ma come al solito senza la password.

    qualche altra idea?

  5. #5
    chiedo venia!!! (come disse la siringhia)

    Funziona tutto perfettamente solo che la mia ignoranza in materia e la mia disattenzione han fatto si che riuscissi a non farlo funzionare...!!

    Grazie mille!!!!

  6. #6

  7. #7

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.