Ciao a tutti,
vi posto qui una function di esempio:
Per poi richiamare la funzione così:codice:Function rs_viewuser(desField) 'Creo una nuova stringa SQL If Replace(Request.QueryString("username"), "'", "''") <> "" Then viewuserSQL = "SELECT * FROM tbl_utenti WHERE name='" & Replace(Request.QueryString("username"), "'", "''")& "'" End If Set RS2 = Server.CreateObject ("ADODB.RecordSet") RS2.Open viewuserSQL,cString dim icountz icountz = 0 if not RS2.eof then if RS2("stato") = "Disabled" then icountz = 1 disable = RS2("name") end if retField2 = RS2(desField) end if RS2.Close Set RS2 = Nothing if icountz = 1 then adoCon.Close Set adoCon = Nothing response.redirect("login.asp") end if rs_viewuser = retField2 End Function
Avere un redirect all'interno di una function non è nulla di problematico per la stabilità del codice?codice:Ciao <%=rs_viewuser("name")%>!
Grazie
ciao Roby![]()

Rispondi quotando