Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Jul 2007
    Messaggi
    196

    problema registrazione account

    ciao ragazzi ,

    scusate il disturbo..
    non riesco a far funzionare questa pagina di registrazione dell'account..

    una volta che compilo tutti i dati e premo su "registra" mi manda alla pagina successiva ma senza trovare errori.. come mai ? dove sbaglio ?








    <%
    If Request.QueryString("step") = "registra" Then
    Dim str_db_username 'username
    Dim str_wanted_username 'richiesto username
    Dim str_new_usercode 'generare user code
    Dim int_random_number 'numero random
    Dim int_random_number_max 'valore massimo del numero randomico
    Dim int_random_number_min 'valore minimo del numero randomico
    Dim str_password 'password
    Dim rs_new_user 'Recordsheet per il nuovo utente
    Dim rs_check_username 'Recordsheet per controllare username

    'Richiamo i valori
    str_wanted_username = Request.form("username")
    str_password = Request.form("pw1")

    'Creo una nuova stringa SQL
    strSQL = "SELECT * FROM tbl_authors"

    'Creo un nuovo RecordSet
    set rs_check_username=Server.CreateObject("ADODB.Recor dset")

    'Apro il recordset e eseguo SQL
    rs_check_username.Open strSQL,adoCon

    'Eseguo un ciclo fino alla fine
    Do While NOT rs_check_username.EOF
    'Set variable to hold a database username value
    str_db_username = rs_check_username("name")

    'See l'username è già inserito nel database response.Redirect("errore.asp")
    If str_db_username = str_wanted_username Then Response.Redirect("errore.asp")

    'passo al record successivo
    rs_check_username.MoveNext
    'Loop
    Loop

    rs_check_username.Close
    Set rs_check_username = Nothing

    new_name = Request.form("username")
    new_email = Request.form("email")
    new_pass = Request.form("pw1")
    new_nome = Request.form("nome")
    new_cognome = Request.form("cognome")
    new_citta = Request.form("citta")
    new_provincia = Request.form("provincia")
    new_cap = Request.form("cap")
    new_authority = "user"
    new_code = str_new_usercode
    new_pagina_web = Request.form("pagina_web")

    If new_name = "" OR new_email = "" OR new_pass = "" OR new_nome = "" OR new_cognome = "" OR new_citta = "" OR new_cap = "" Then
    emptyValue = True
    Else
    If Request.Form("pw1") <> Request.Form("pw2") Then
    badPass = True
    Else
    badPass = False
    End If
    emptyValue = False
    End If

    If emptyValue = False AND badPass = False Then
    'Creo un numero random
    Randomize
    int_random_number_Min = 1
    int_random_number_Max = 999999999
    int_random_number = Int(((int_random_number_Max-int_random_number_Min+1) * Rnd) + int_random_number_Min)

    'converto il numero in una stringa
    int_random_number = Cstr(int_random_number)

    'concateno username e il numero random
    str_new_usercode = str_wanted_username + int_random_number

    'Creo una nuova stringa SQL
    strsql="SELECT * FROM tbl_authors"

    'Creo un nuovo recordset
    set rs_new_user = Server.CreateObject("ADODB.Recordset")

    rs_new_user.CursorType = 2
    rs_new_user.LockType = 3

    'apro recordsheet e eseguo la stringa SQL
    rs_new_user.open strsql,adocon

    'setto recordsheet e aggiungo un nuovo record
    rs_new_user.AddNew

    'Enter a new record into the database
    rs_new_user.Fields("name") = new_name
    rs_new_user.Fields("email") = new_email
    rs_new_user.Fields("pass") = new_pass
    rs_new_user.Fields("nome") = new_nome
    rs_new_user.Fields("cognome") = new_cognome
    rs_new_user.Fields("citta") = new_citta
    rs_new_user.Fields("provincia") = new_provincia
    rs_new_user.Fields("cap") = new_cap
    rs_new_user.Fields("authority") = "user"
    rs_new_user.Fields("dataregistrazione") = date()
    rs_new_user.Fields("code") = str_new_usercode
    rs_new_user.Fields("pagina_web") = Request.form("pagina_web")
    If conf_email = "False" Then
    rs_new_user.Fields("stato") = "Active"
    End If

    'aggiorno il recordset
    rs_new_user.Update

    rs_new_user.Close
    set rs_new_user = Nothing

    curSubFolders = ""
    tempArray = Split(Replace(Request.ServerVariables("URL"), "\", "/"), "/")
    Dim i
    i = 0
    For each chunk in tempArray
    i = i + 1
    Next
    For j = 0 to (i-2)
    curSubFolders = curSubFolders & tempArray(j) & "/"
    Next

    If conf_email = "True" AND tipoMail <> "None" Then
    strFromName = pageTitle & " Webmaster"
    strFromEmail = adminEmail
    strRecipientsEmail = new_email
    strRecipientsName = new_name
    strSubject = pageTitle & " Registrazione Sito"
    strMessage = "------------------------------------------" & vbCrLf & _
    "Grazie per esserti registrato, " & strRecipientsName & "! " & vbCrLf & _
    "Prima di attivare il tuo account è necessario compiere un ultimo passaggio per completare la registrazione!" & vbCrLf & vbCrLf & _
    "Nota bene - devi completare questo passaggio per diventare un utente registrato." & vbCrLf & _
    "Sarà necessario cliccare sul link una sola volta e il tuo account verrà automaticamente aggiornato." & vbCrLf & vbCrLf & _
    "Per completare la registrazione, clikka sul seguente indirizzo:" & vbCrLf & _
    " " & homePage & curSubFolders & "attivo.asp?userCode=" & str_new_usercode & vbCrLf & vbCrLf & _
    "Grazie," & vbCrLf & pageTitle & " Webmaster"

    Select Case LCase(tipoMail)
    Case "aspemail"
    Set objNewMail = Server.CreateObject("Persits.MailSender")
    objNewMail.Host = mailServer
    objNewMail.FromName = strFromName
    objNewMail.AddReplyTo strFromEmail
    objNewMail.From = strFromEmail
    objNewMail.AddAddress strRecipientsEmail, strRecipientsName
    objNewMail.Subject = strSubject
    objNewMail.Body = strMessage
    On Error Resume Next '## Ignora Errore
    objNewMail.Send
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email: " & Err.Description & ""
    End if
    Case "aspmail"
    Set objNewMail = Server.CreateObject("SMTPsvg.Mailer")
    objNewMail.FromName = strFromName
    objNewMail.FromAddress = strFromEmail
    'objNewMail.AddReplyTo = strFromEmail
    objNewMail.RemoteHost = mailServer
    objNewMail.AddRecipient strRecipientsName, strRecipientsEmail
    objNewMail.Subject = strSubject
    objNewMail.BodyText = strMessage
    On Error Resume Next '## Ignora Errore
    SendOk = objNewMail.SendMail
    If not(SendOk) <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & objNewMail.Response & ""
    End if
    Case "cdonts"
    Set objNewMail = Server.CreateObject ("CDONTS.NewMail")
    objNewMail.BodyFormat = 1
    objNewMail.MailFormat = 0
    On Error Resume Next '## Ignora Errore
    objNewMail.Send strFromEmail, strRecipientsEmail, strSubject, strMessage
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    On Error Resume Next '## Ignora Errore

    Case "cdosys"
    Set objMessage = CreateObject("CDO.Message")
    objMessage.From = adminEmail
    objMessage.TextBody = strMessage
    objMessage.To = strRecipientsEmail
    objMessage.Subject = strSubject
    objMessage.Send
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    On Error Resume Next '## Ignora Errore



    Case "chilicdonts"
    Set objNewMail = Server.CreateObject ("CDONTS.NewMail")
    On Error Resume Next '## Ignora Errore
    objNewMail.Host = mailServer
    objNewMail.To = strRecipientsEmail
    objNewMail.From = strFromEmail
    objNewMail.Subject = strSubject
    objNewMail.Body = strMessage
    objNewMail.Send
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    On Error Resume Next '## Ignora Errore
    Case "jmail"
    Set objNewMail = Server.CreateObject("Jmail.smtpmail")
    objNewMail.ServerAddress = mailServer
    objNewMail.AddRecipient strRecipientsEmail
    objNewMail.Sender = strFromEmail
    objNewMail.Subject = strSubject
    objNewMail.Body = strMessage
    objNewMail.Priority = 3
    On Error Resume Next '## Ignora Errore
    objNewMail.Execute
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    Case "jmail4"
    Set objNewMail = Server.CreateObject("Jmail.Message")
    'objNewMail.MailServerUserName = "mioUserName"
    'objNewMail.MailServerPassword = "MiaPassword"
    objNewMail.From = strFromEmail
    objNewMail.FromName = strFromName
    objNewMail.AddRecipient strRecipientsEmail, strRecipientsName
    objNewMail.Subject = strSubject
    objNewMail.Body = strMessage
    On Error Resume Next '## Ignora Errore
    objNewMail.Send(mailServer)
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    Case "smtp"
    Set objNewMail = Server.CreateObject("SmtpMail.SmtpMail.1")
    objNewMail.MailServer = mailServer
    objNewMail.Recipients = strRecipientsEmail
    objNewMail.Sender = strFromEmail
    objNewMail.Subject = strSubject
    objNewMail.Message = strMessage
    On Error Resume Next '## Ignora Errore
    objNewMail.SendMail2
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    End Select
    Set objNewMail = Nothing
    On Error Goto 0


    Response.Redirect("benvenuto.asp")
    Else
    Session("tmpUN") = new_name
    Response.Redirect("login.asp?disp=login")
    End If
    End If
    End If
    %>

  2. #2
    Utente di HTML.it
    Registrato dal
    Jul 2007
    Messaggi
    196
    questo è il post :

    <form id="test" name="registrationForm" method="post" action="registrazione.asp?step=registra" >

    questo è l'invio :

    <input type="submit" value="Registrati" onClick="DoSubmit(document.registrationForm)">
    <input type="button" value="Reset" onClick="valid.reset(); return false" /></center>

  3. #3
    Utente di HTML.it
    Registrato dal
    Jul 2007
    Messaggi
    196
    ho modificato l'invio in :

    <input type="submit" value="Registrati" onClick="registrazione.asp?step=registra"
    <input type="button" value="Reset" onClick="valid.reset(); return false" /></center>


    ma non cambia nulla...

    qui trovate la pagina online :

    www.megacommunity.it/registrazione.asp


    mi aiutate x favoreee

  4. #4
    Utente di HTML.it
    Registrato dal
    Jul 2007
    Messaggi
    196
    ok risolto.. avevo sbagliato in un controllo..

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 © 2026 vBulletin Solutions, Inc. All rights reserved.