Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

KERNELL

Examinar Codigo

Recommended Posts

Bem galerinha, gostaria de pedir a gentileza aos experts para que me dizem o que há de errado com esse côdigo para que não faça a parte de filtro ou seja a parte de Request.form onde deveria puxar o parametro está sendo ignorada, só a parte de login que está trabalhando ok.codigo da pagina login<%@LANGUAGE="VBSCRIPT"%><!--#include file="Connections/rambalde.asp" --><%' *** 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("login"))If MM_valUsername <> "" ThenMM_fldUserAuthorization=""MM_redirectLoginSuccess="resultados.asp"MM_redirectLoginFailed="erro.asp"MM_flag="ADODB.Recordset"set MM_rsUser = Server.CreateObject(MM_flag)MM_rsUser.ActiveConnection = MM_rambalde_STRINGMM_rsUser.Source = "SELECT LOGIN, SENHA"If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorizationMM_rsUser.Source = MM_rsUser.Source & " FROM USUARIO WHERE LOGIN='" & Replace(MM_valUsername,"'","''") &"' AND SENHA='" & Replace(Request.Form("senha"),"'","''") & "'"MM_rsUser.CursorType = 0MM_rsUser.CursorLocation = 2MM_rsUser.LockType = 3MM_rsUser.OpenIf Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then ' username and password match - this is a valid userSession("MM_Username") = MM_valUsernameIf (MM_fldUserAuthorization <> "") ThenSession("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)ElseSession("MM_UserAuthorization") = ""End Ifif CStr(Request.QueryString("accessdenied")) <> "" And false ThenMM_redirectLoginSuccess = Request.QueryString("accessdenied")End IfMM_rsUser.CloseResponse.Redirect(MM_redirectLoginSuccess)End IfMM_rsUser.CloseResponse.Redirect(MM_redirectLoginFailed)End If%><form name="form1" method="POST" action="<%=MM_LoginAction%>"><table width="200"><tr><td>LOGIN</td><td><input name="login" type="text" id="login"></td></tr><tr><td>SENHA</td><td><input name="senha" type="text" id="senha"></td></tr><tr><td colspan="2"><input type="submit" name="Submit" value="ENVIAR"></td></tr></table><p>TIPO:<input name="cor" type="text" id="cor"></p></form>-----------------------------------------------codigo da pagina resultados<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%><!--#include file="Connections/rambaldi.asp" --><%var Recordset1__MMColParam = "1";if (String(Request.Form("cor")) != "undefined" && String(Request.Form("cor")) != "") { Recordset1__MMColParam = String(Request.Form("cor"));}%><%// *** Restrict Access To Page: Grant or deny access to this pagevar MM_authorizedUsers="";var MM_authFailedURL="erro.asp";var MM_grantAccess=false;if (String(Session("MM_Username")) != "undefined") {if (true || (String(Session("MM_UserAuthorization"))=="") || (MM_authorizedUsers.indexOf(String(Session("MM_UserAuthorization"))) >=0)) {MM_grantAccess = true;}}if (!MM_grantAccess) {var MM_qsChar = "?";if (MM_authFailedURL.indexOf("?") >= 0) MM_qsChar = "&";var MM_referrer = Request.ServerVariables("URL");if (String(Request.QueryString()).length > 0) MM_referrer = MM_referrer + "?" + String(Request.QueryString());MM_authFailedURL = MM_authFailedURL + MM_qsChar + "accessdenied=" + Server.URLEncode(MM_referrer);Response.Redirect(MM_authFailedURL);}%><%var Recordset1 = Server.CreateObject("ADODB.Recordset");Recordset1.ActiveConnection = MM_rambaldi_STRING;Recordset1.Source = "SELECT * FROM REGISTRO WHERE COR = '"+ Recordset1__MMColParam.replace(/'/g, "''") + "'";Recordset1.CursorType = 0;Recordset1.CursorLocation = 2;Recordset1.LockType = 1;Recordset1.Open();var Recordset1_numRows = 0;%><%var Repeat1__numRows = -1;var Repeat1__index = 0;Recordset1_numRows += Repeat1__numRows;%><!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><title>ccas</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head><body><table border="1" cellpadding="1" cellspacing="1"><tr><td>ID-REGISTRO</td><td>CLIENTE</td><td>IMPORTADOR</td><td>FATURA</td><td>CONTATO</td><td>COR</td></tr><% while ((Repeat1__numRows-- != 0) && (!Recordset1.EOF)) { %><tr><td><%=(Recordset1.Fields.Item("ID-REGISTRO").Value)%></td><td><%=(Recordset1.Fields.Item("CLIENTE").Value)%></td><td><%=(Recordset1.Fields.Item("IMPORTADOR").Value)%></td><td><%=(Recordset1.Fields.Item("FATURA").Value)%></td><td><%=(Recordset1.Fields.Item("CONTATO").Value)%></td><td><%=(Recordset1.Fields.Item("COR").Value)%></td></tr><%Repeat1__index++;Recordset1.MoveNext();}%></table><p>a cor selecionada foi <%= Request("cor") %></p></body></html><%Recordset1.Close();%>---------------------Alguém se habilita a me dizer porque a parte de login funciona, mas a parte do filtro não?Valeu

Compartilhar este post


Link para o post
Compartilhar em outros sites

to foraaaaaaa............ hahahhaa brincadeira cara!!!!!!!!!Cara coloque as linhas que você acha deve ser o erro, pq naum é todo mundo que tem pasiencia para ler este codigo todo hehehe!!!!!!!fALO!!!!!!!!!!!!!!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.