Grazie, ti mando la pagina, se cortesemente mi indichi dove e come mettere il request.form di cui parli mi faresti un grosso favore.
Di seguito ti invio il codice asp della pagina di login
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_utentisito_STRING
Recordset1_cmd.CommandText = "SELECT * FROM utenti"
Recordset1_cmd.Prepared = true
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername = CStr(Request.Form("textfield"))
If MM_valUsername <> "" Then
Dim MM_fldUserAuthorization
Dim MM_redirectLoginSuccess
Dim MM_redirectLoginFailed
Dim MM_loginSQL
Dim MM_rsUser
Dim MM_rsUser_cmd
MM_fldUserAuthorization = ""
MM_redirectLoginSuccess = "/utenti/index.asp"
MM_redirectLoginFailed = "/utenti/login.asp"
MM_loginSQL = "SELECT utente, password"
If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM utenti WHERE utente = ? AND password = ?"
Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
MM_rsUser_cmd.ActiveConnection = MM_utentisito_STRING
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 50, MM_valUsername) ' adVarChar
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 50, Request.Form("textfield2")) ' adVarChar
MM_rsUser_cmd.Prepared = true
Set MM_rsUser = MM_rsUser_cmd.Execute
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
'Invio del cookie (assegnazione del valore)
response.cookies("MM_Username2")=MM_valUsername
'Definizione del Expires (scadenza tra 1 anno il tempo esatto)
response.cookies("MM_Username2").Expires = dateAdd("n",30, Now)
'Definizione del secure
Session("MM_Username2") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization ).Value)
Else
Session("MM_UserAuthorization") = ""
End If
Session("MM_Username2") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization ).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="robots" content="noarchive">
<link href="/stile.css" rel="stylesheet" type="text/css" />
<title>Login</title></head>
<body>
<div id="container">
<div id="banner"></div>
<div id="sidebar-a"></div>
<div id="content">
<p class="titoli">Login</p>
<table class="tabella" width="92%" align="center">
<tr>
<td height="94" align="center"><form id="form1" name="form1" method="POST" action="<%=MM_LoginAction%>">
<label>
</label>
<table width="60%" border="0" cellpadding="5" cellspacing="5">
<tr>
<td width="35%">Nome utente:</td>
<td width="65%"><input name="textfield" type="text" size="18" /></td>
</tr>
<tr>
<td><label>Password:</label>
<label> </label></td>
<td><input name="textfield2" type="text" size="18" /></td>
</tr>
</table>
<label>
</label>
<label></label>
<label>
<input type="submit" name="Submit" value="Invia" />
</label>
</form>
<p align="center">
Se non sei ancora registrato puoi farlo adesso: registrati </p>
</p></td>
</tr>
</table>
</p>
</div>
<div id="footer">
<table width="100%" border="0">
<tr>
<td>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

Rispondi quotando