|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Comparing MSSQL data with request.form
Hi Gurus - I do need a good help from You:
1 - I use Windows 2000 Server, MSSQL 2000, building the site (in .ASP) "www.contratosonline.com.br", for writing-yourself-Contracts on line. 2 - In pages like "http://www.contratosonline.com.br/contratos/aditamentoloc/1190aditamentoloc.asp", there's the code: "Nome de Usuário ("username") <INPUT class="input" type=text name="username" id="username" size=15 maxLength=50 onfocus="style.backgroundColor='#E6E8FA'; style.color='#8E236B'" onblur="style.backgroundColor='#FFFFFF'; style.color='#000088'">" -- and another similar input for 'name="password". 3 - this form, method="POST", must take those 02 data to the (hidden) page "check1190.asp", where they will be compared with the "name" and "password" of the table "Members" of the MSSQL DB "Members", that's to say, to "allow" their access; the code is: "<%@ LANGUAGE = "VBScript" ENABLESESSIONSTATE = False %> <% Option Explicit %> <!-- #include virtual="../../inc/inc-conexao.asp"--> <!-- #include virtual="../../inc/adovbs.inc"--> <% Dim username, name, password, tabelatitulo, contratonome username=Request.Form("username") password=Request.Form("password") Dim objConn, objRS, rs, strSQL, id, strConnection Call abre_objConn 'abre means open Set objRS = Server.CreateObject("ADODB.Recordset") Set objRS.ActiveConnection = objConn strSQL="SELECT Members.name, Members.password FROM Members WHERE name = '" & username & "' AND password = '" & password & "'" objRS.Open strSQL While Not objRS.EOF tabelatitulo="aditamentoloc" contratonome=request.Form("contratonome") ' Criate the cookies response.cookies("remain")=username response.cookies("still")=password response.cookies("idtabela")=tabelatitulo response.cookies("idcontrato")=contratonome If Request.Form("username")=objRS("name") AND Request.Form("password")=objRS("password") AND Request.Form("contratonome")<>"" Then Response.redirect("../../contratos/aditamentoloc/aut1190.asp") Else....." 4 - In that page, the configuration of the connection is made with an include file ("inc-conexao.asp") with this code: "<% sub abre_objConn ' abre means open Set objConn = Server.CreateObject("ADODB.Connection") strConnection = "Driver={SQL Server};SERVER=sql.rjnet.com.br;UID=XXX;PWD=XXX;DA TABASE=XXX" objConn.Open strConnection end sub sub fecha_objConn ' fecha means close objConn.close Set objConn = Nothing end sub %>". 5 - IF the User is already registered, his/her data go to the page "aut1190.asp" where this request and the data will be included in the tables with the data of this new Contract that will be written, built. 6 - The "hell" is that, when I run the program -- using, of course, the name+password of a (registered) PATTERN-User, the program alerts me that... "It was not possible to autenticate the data of the User or of the password.....". ??!????!@#*&@? Thaks a lot, in advance, for your kind help! Dalton, Rio de Janeiro Last edited by dig : April 14th, 2005 at 02:04 PM. Reason: Correcting same bad explanation. Sorry! |
|
#2
|
|||
|
|||
|
Already solved the problem.
Thaks a lot, anyway, for your kind help! Dalton, Rio de Janeiro |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Comparing MSSQL data with request.form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|