lucianorossi
17-06-2003, 00:11
siccome io non ne capisco niente, mi sono affidato all'editor dreamwiever, ma purtroppo la pagina che mi ha generato mi continua a dare errore di login anche quando username e password sono giusti  
Purtroppo dremwiever permette l'autoconfigurazione del login solo in .cfm e .jsp, linguaggi a me sconosciuti
 
<cfif IsDefined("FORM.username")>
<cfset MM_redirectLoginSuccess="main.cfm">
<cfset MM_redirectLoginFailed="404.html">
<cfquery name="MM_rsUser" datasource="Sito_write" username="Giorgio">
SELECT username,password FROM utenti WHERE username='#FORM.username#' AND password='#FORM.password#'
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.username>
<cfset Session.MM_UserAuthorization="">
</cflock>
<cfif IsDefined("URL.accessdenied") AND false>
<cfset MM_redirectLoginSuccess=URL.accessdenied>
</cfif>
<cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
<cfcatch type="Lock"><!--- code for handling timeout of cflock --->
</cfcatch>
</cftry>
</cfif>
<cflocation url="#MM_redirectLoginFailed#" addtoken="no">
<cfelse>
<cfset MM_LoginAction=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_LoginAction=MM_LoginAction & "?" & CGI.QUERY_STRING>
</cfif>
</cfif>
<html>
<head>
<title>Documento senza titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h3 align="center"><font size="+4">Alcoholer Database</font></h3>
<p align="center"><font size="3">This Web site is password protected</font></p>
<p align="center"><font size="3">Please Log-in</font></p>
<form action="<cfoutput>#MM_loginAction#</cfoutput>" method="POST" name="main_login" id="main_login">
<p align="center"><font size="3">Username:
<input name="username" type="text" value="guest" maxlength="20">
</font></p>
<p align="center"><font size="3">Password:
<input name="password" type="password" maxlength="10">
</font></p>
<p align="center"><font size="3">
<input type="submit" name="Submit" value="Log-In">
</font></p>
</form>
<p align="center">&nbsp;</p>
</body>
</html>
 
parte incriminata in liguaggio .cfm
Purtroppo dremwiever permette l'autoconfigurazione del login solo in .cfm e .jsp, linguaggi a me sconosciuti
<cfif IsDefined("FORM.username")>
<cfset MM_redirectLoginSuccess="main.cfm">
<cfset MM_redirectLoginFailed="404.html">
<cfquery name="MM_rsUser" datasource="Sito_write" username="Giorgio">
SELECT username,password FROM utenti WHERE username='#FORM.username#' AND password='#FORM.password#'
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.username>
<cfset Session.MM_UserAuthorization="">
</cflock>
<cfif IsDefined("URL.accessdenied") AND false>
<cfset MM_redirectLoginSuccess=URL.accessdenied>
</cfif>
<cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
<cfcatch type="Lock"><!--- code for handling timeout of cflock --->
</cfcatch>
</cftry>
</cfif>
<cflocation url="#MM_redirectLoginFailed#" addtoken="no">
<cfelse>
<cfset MM_LoginAction=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_LoginAction=MM_LoginAction & "?" & CGI.QUERY_STRING>
</cfif>
</cfif>
<html>
<head>
<title>Documento senza titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h3 align="center"><font size="+4">Alcoholer Database</font></h3>
<p align="center"><font size="3">This Web site is password protected</font></p>
<p align="center"><font size="3">Please Log-in</font></p>
<form action="<cfoutput>#MM_loginAction#</cfoutput>" method="POST" name="main_login" id="main_login">
<p align="center"><font size="3">Username:
<input name="username" type="text" value="guest" maxlength="20">
</font></p>
<p align="center"><font size="3">Password:
<input name="password" type="password" maxlength="10">
</font></p>
<p align="center"><font size="3">
<input type="submit" name="Submit" value="Log-In">
</font></p>
</form>
<p align="center">&nbsp;</p>
</body>
</html>
parte incriminata in liguaggio .cfm