Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2001
    Messaggi
    262

    Problemi nel gestire If Then

    salve a tutto il forum.
    il mio problema è che non riesco a ben gestire delle condizioni If Then, nel senso che pur avendo completato lo script (nn mio)
    mi segue questo errore:

    codice:
    Tipo di errore:
    Errore di compilazione di Microsoft VBScript (0x800A03F6)
    Previsto 'End'
    /prova_login/prova login/txt/reg_ut.asp, line 117
    se aggiungo un End If

    la pagina appare bianca è non spunta la login.
    Credo ke sia un problema di corretta gestione di If Then, ma io nn riesco a capire lo sbaglio, se x favore qlk mi da una mano...


    [CODE]
    <html>
    <head>
    <title>Registrazio digitate ne al sito di Fiel_TV</title>
    <%
    submit = Request.ServerVariables("REQUEST_METHOD")="POST"
    pagina=Request.ServerVariables("PATH_INFO")
    errore=False

    If submit Then

    nick=TRIM(Request.Form("nick"))
    passw=TRIM(Request.Form("passw"))
    email=TRIM(Request.Form("email"))
    liv_ut=TRIM(Request.Form("liv_ut"))

    If len(nick) = 0 Then
    errore=True
    messaggio=messaggio& "Il nick è un campo obbligatorio!
    "
    End If

    If len(passw) = 0 Then
    errore=True
    messaggio=messaggio& "La password è un campo obbligatorio!
    "
    End If

    If len(repassw) = 0 Then
    errore=True
    messaggio=messaggio& "Ridigita la password!
    "
    End If

    If len(email) = 0 Then
    errore=True
    messaggio=messaggio& "La E-mail è un campo obbligatorio!
    "
    End If

    If Len (passw) >0 And len (repassw) >0 Then
    If StrComp(passw,repassw,0)<>0 Then
    errore=True
    messaggio=messaggio&"Le password non coincidono!
    "
    End If
    End If

    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("../mdb-database/utenti.mdb")

    If Not errore Then
    nick=Replace(nick,"","")
    sql="select nick from utenti where nick=""& nick&"""
    Set Rs=Conn.Execute(sql)

    If Not Rs.EOF Then
    errore=True
    messaggio="Il nick scelto è già occupato
    "
    End If

    If Not errore Then
    passw=Replace(passw,"","")
    email=Replace(email,"","")
    sql="Insert into utenti"&_
    "(nick,passw,email)"&_
    "VALUES("'&nick&'","'&passw&'","'&email&"')"
    Conn.Execute(sql)
    messaggio="Registrazione eseguita con successo!"
    End If
    Conn.Close
    Set Conn=Nothing
    End If
    %>
    </body>
    </head>
    </html>

    <html>
    <head>
    <title>REGISTRAZIONE UTENTE</title>
    </head>
    <body>
    <%If Not submit Then %>
    <form name="registrazione" method="post" action="<%=pagina%>"">



    <table width="200" border="1" align="center">
    <tr>
    <td><div align="center">nick
    <input type="text" name="nick">
    </div></td>
    <td><div align="center">passw
    <input type="text" name="passw">
    </div></td>
    </tr>
    <tr>
    <td><div align="center">ridigita password
    <input type="password" name="repassw">
    </div></td>
    <td><div align="center">email
    <input type="text" name="email">
    </div></td>
    </tr>
    <tr>
    <td><div align="center">
    <input type="submit" value="Registra">
    </div></td>
    <td><div align="center">
    <input type="reset" name="Submit" value="Cancella">
    </div></td>
    </tr>
    </table>


    <input name="liv_ut" type="hidden" value="">


    </form>
    <%Else%>
    <%=messaggio%>

    <%If errore Then%>
    Correggi
    <%End If%>
    (L.117)<%End If%>

    </body>
    </html>

  2. #2
    Prva così:

    codice:
    <html> 
    <head> 
    <title>Registrazio digitate ne al sito di Fiel_TV</title> 
    <% 
    submit = Request.ServerVariables("REQUEST_METHOD")="POST" 
    pagina=Request.ServerVariables("PATH_INFO") 
    errore=False 
    
    If submit Then 
    
    	nick=TRIM(Request.Form("nick")) 
    	passw=TRIM(Request.Form("passw")) 
    	email=TRIM(Request.Form("email")) 
    	liv_ut=TRIM(Request.Form("liv_ut")) 
    	
    	If len(nick) = 0 Then 
    	errore=True 
    	messaggio=messaggio& "Il nick è un campo obbligatorio!
    " 
    	End If 
    	
    	If len(passw) = 0 Then 
    	errore=True 
    	messaggio=messaggio& "La password è un campo obbligatorio!
    " 
    	End If 
    	
    	If len(repassw) = 0 Then 
    	errore=True 
    	messaggio=messaggio& "Ridigita la password!
    " 
    	End If 
    	
    	If len(email) = 0 Then 
    	errore=True 
    	messaggio=messaggio& "La E-mail è un campo obbligatorio!
    " 
    	End If 
    
    	If Len (passw) >0 And len (repassw) >0 Then 
    		If StrComp(passw,repassw,0)<>0 Then 
    			errore=True 
    			messaggio=messaggio&"Le password non coincidono!
    " 
    		End If 
    	End If 
    
    	Set Conn = Server.CreateObject("ADODB.Connection") 
    	Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("../mdb-database/utenti.mdb") 
    
    	If Not errore Then 
    		nick=Replace(nick,"","") 
    		sql="select nick from utenti where nick=""& nick&""" 
    		Set Rs=Conn.Execute(sql) 
    
    		If Not Rs.EOF Then 
    			errore=True 
    			messaggio="Il nick scelto è già occupato
    " 
    		End If 
    
    		If Not errore Then 
    			passw=Replace(passw,"","") 
    			email=Replace(email,"","") 
    			sql="Insert into utenti"&_ 
    			"(nick,passw,email)"&_ 
    			"VALUES("'&nick&'","'&passw&'","'&email&"')" 
    			Conn.Execute(sql) 
    			messaggio="Registrazione eseguita con successo!" 
    		End If 
    		Conn.Close 
    		Set Conn=Nothing 
    	End If 
    
    end if
    %> 
    </body> 
    </head> 
    </html> 
    
    <html> 
    <head> 
    <title>REGISTRAZIONE UTENTE</title> 
    </head> 
    <body> 
    <%If Not submit Then %> 
    <form name="registrazione" method="post" action="<%=pagina%>""> 
    
     
    
    <table width="200" border="1" align="center"> 
    <tr> 
    <td><div align="center">nick 
    <input type="text" name="nick"> 
    </div></td> 
    <td><div align="center">passw 
    <input type="text" name="passw"> 
    </div></td> 
    </tr> 
    <tr> 
    <td><div align="center">ridigita password 
    <input type="password" name="repassw"> 
    </div></td> 
    <td><div align="center">email 
    <input type="text" name="email"> 
    </div></td> 
    </tr> 
    <tr> 
    <td><div align="center"> 
    <input type="submit" value="Registra"> 
    </div></td> 
    <td><div align="center"> 
    <input type="reset" name="Submit" value="Cancella"> 
    </div></td> 
    </tr> 
    </table> 
    
     
    <input name="liv_ut" type="hidden" value=""> 
    
     
    </form> 
    <%Else%> 
    <%=messaggio%>
     
    <%If errore Then%> 
    Correggi 
    <%End If%> 
    (L.117)<%End If%> 
    
    </body> 
    </html>
    "Link2me.it: Professional network e Marketplace"
    www.link2me.it

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2001
    Messaggi
    262
    scusa x la risposta in ritardo (ho passato una notte un "alcolica" )ma mi sn ripreso solo ora.
    grazie funge tutto benone,,
    quando vuoi t offro una birra

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.