Ir para conteúdo

POWERED BY:

Arquivado

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

Ari Viana

página de busca

Recommended Posts

Eaí galera, preciso da ajuda de vcs. Estou construindo um site para cadastro de currículos. o banco de dados já esta ok(sql server 2000 e a linguagem é asp) e já inclui alguns cadastros para testar o site, até aí tudo bem. O problema é na página de login dos usuários já cadastrados. Coloquei 02 parâmetros de busca(e-mail e senha) mas qdo acesso a página de login e entro com os dados de um usuário cadastrado a página de resultados não mostra os dados do mesmo e sim os dados do primeiro registro do banco de dados. O sistema está puxando os dados por ordem de cadastro no banco de dados e não os dados do usuário que está se logando.Pergunta:Como faço para a página após o login do usuário mostras os dados do cliente que está se logando e não os dados do primeiro registro do bd????Se alguem puder ajudar, serei grato amigosUm abraçoAri

Compartilhar este post


Link para o post
Compartilhar em outros sites

você pode postar como está fazendo a busca?

Compartilhar este post


Link para o post
Compartilhar em outros sites

La vai Salgado, Um abraço caraEssa é a página de logon<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%><!--#include file="Connections/Vanguarda.asp" --><%// *** Validate request to log in to this site.var MM_LoginAction = Request.ServerVariables("URL");if (Request.QueryString!="") MM_LoginAction += "?" + Request.QueryString;var MM_valUsername=String(Request.Form("email"));if (MM_valUsername != "undefined") { var MM_fldUserAuthorization="pri_acesso"; var MM_redirectLoginSuccess="resu_bcur.asp"; var MM_redirectLoginFailed="acescurr_negado.asp"; var MM_flag="ADODB.Recordset"; var MM_rsUser = Server.CreateObject(MM_flag); MM_rsUser.ActiveConnection = MM_Vanguarda_STRING; MM_rsUser.Source = "SELECT e_mail, senh_a"; if (MM_fldUserAuthorization != "") MM_rsUser.Source += "," + MM_fldUserAuthorization; MM_rsUser.Source += " FROM dbo.Cad_Curriculo WHERE e_mail='" + MM_valUsername.replace(/'/g, "''") + "' AND senh_a='" + String(Request.Form("senha")).replace(/'/g, "''") + "'"; MM_rsUser.CursorType = 0; MM_rsUser.CursorLocation = 2; MM_rsUser.LockType = 3; MM_rsUser.Open(); if (!MM_rsUser.EOF || !MM_rsUser.BOF) { // username and password match - this is a valid user Session("MM_Username") = MM_valUsername; if (MM_fldUserAuthorization != "") { Session("MM_UserAuthorization") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value); } else { Session("MM_UserAuthorization") = ""; } if (String(Request.QueryString("accessdenied")) != "undefined" && false) { MM_redirectLoginSuccess = Request.QueryString("accessdenied"); } MM_rsUser.Close(); Response.Redirect(MM_redirectLoginSuccess); } MM_rsUser.Close(); Response.Redirect(MM_redirectLoginFailed);}%><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Entre com seu E-Mail e sua Sentre para utilizar nossos serviços ou cadastre-se agora</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head><body bgcolor="#0099CC" text="#FFFFFF" link="#000000" vlink="#000000" alink="#000000"><div align="center"> <p><font color="#FFFFFF">Entre com seu seu e-mail e sua senha para ter acesso a todos os nossos serviços de acordo com o seu tipo de cadastro ou inclua seu Currículo agora</font><font color="#0000CC"> <a href="cada_curriculo.asp">Clicando aqui</a></font></p> <form action="<%=MM_LoginAction%>" method="POST" enctype="application/x-www-form-urlencoded" name="LogonCurri" target="_parent" id="LogonCurri"> <table width="95%" border="1" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td width="15%"><font color="#000000">E-Mail:</font></td> <td width="85%"><input name="email" type="text" id="email" size="60" maxlength="50" /></td> </tr> <tr> <td><font color="#000000">Senha:</font></td> <td><input name="senha" type="password" id="senha" size="60" maxlength="50" /></td> </tr> <tr> <td colspan="2"><div align="center"> <input name="Entrar" type="submit" id="Entrar" value="Entrar" /> </div></td> </tr> </table> </form> <p> </p></div></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

E essa é a página de resultados caraA minha dúvida é sobre o preenchimento da caixa de diálogo 'conjunto de registros'. Não sei se estou preenchendo os campos corretamentee a instrução sql acredito estar correta<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%><!--#include file="Connections/Vanguarda.asp" --><%var vercurriculo__varemail = "%";if (String(Request. Form("email")) != "undefined" && String(Request. Form("email")) != "") { vercurriculo__varemail = String(Request. Form("email"));}%><%var vercurriculo__varsenha = "%";if (String(Request.Form("senha")) != "undefined" && String(Request.Form("senha")) != "") { vercurriculo__varsenha = String(Request.Form("senha"));}%><%var vercurriculo = Server.CreateObject("ADODB.Recordset");vercurriculo.ActiveConnection = MM_Vanguarda_STRING;vercurriculo.Source = "SELECT * FROM dbo.Cad_Curriculo WHERE e_mail LIKE '"+ vercurriculo__varemail.replace(/'/g, "''") + "' AND senh_a LIKE '"+ vercurriculo__varsenha.replace(/'/g, "''") + "'";vercurriculo.CursorType = 0;vercurriculo.CursorLocation = 2;vercurriculo.LockType = 1;vercurriculo.Open();var vercurriculo_numRows = 0;%><% var MM_paramName = ""; %><%// *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters// create the list of parameters which should not be maintainedvar MM_removeList = "&index=";if (MM_paramName != "") MM_removeList += "&" + MM_paramName.toLowerCase() + "=";var MM_keepURL="",MM_keepForm="",MM_keepBoth="",MM_keepNone="";// add the URL parameters to the MM_keepURL stringfor (var items=new Enumerator(Request.QueryString); !items.atEnd(); items.moveNext()) { var nextItem = "&" + items.item().toLowerCase() + "="; if (MM_removeList.indexOf(nextItem) == -1) { MM_keepURL += "&" + items.item() + "=" + Server.URLencode(Request.QueryString(items.item())); }}// add the Form variables to the MM_keepForm stringfor (var items=new Enumerator(Request.Form); !items.atEnd(); items.moveNext()) { var nextItem = "&" + items.item().toLowerCase() + "="; if (MM_removeList.indexOf(nextItem) == -1) { MM_keepForm += "&" + items.item() + "=" + Server.URLencode(Request.Form(items.item())); }}// create the Form + URL string and remove the intial '&' from each of the stringsMM_keepBoth = MM_keepURL + MM_keepForm;if (MM_keepBoth.length > 0) MM_keepBoth = MM_keepBoth.substring(1);if (MM_keepURL.length > 0) MM_keepURL = MM_keepURL.substring(1);if (MM_keepForm.length > 0) MM_keepForm = MM_keepForm.substring(1);%><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Vizualize seus dados </title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head><body bgcolor="#0099CC" text="#FFFFFF" link="#000000" vlink="#000000" alink="#000000"><h3 align="center"><strong><font color="#FFFFFF">Seja bem vindo a Curriculum.com</font></strong></h3><p align="center"><strong><font color="#FFFFFF">O que deseja fazer?</font></strong></p><table width="85%" border="1" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td width="35%"><a href="atua_curriculo.asp?<%= MM_keepForm + ((MM_keepForm!="")?"&":"") + "e_mail=" + vercurriculo.Fields.Item("e_mail").Value %>">Alterar dados</a></td> <td width="29%"><a href="ver_empresa.asp"><a href="ver_empresa.asp">Empresas Cadastradas</a></td> </tr></table><p align="center"><strong><font color="#FFFFFF"></font></strong></p><p align="center"><font color="#FFFFFF">Obs. Esta é uma página apenas para vizualização de seus dados, se deseja atualizar seu Currículo ou pesquisar Empresas cadastradas clique nos links acima</font></p><form action="" method="post" enctype="application/x-www-form-urlencoded" name="VizuaCurr" target="_parent" id="VizuaCurr"> <table width="86%" border="1" align="center"> <tr> <td width="33%">Nome:</td> <td width="67%"><input name="nome" type="text" id="nome" value="<%=(vercurriculo.Fields.Item("nom_e").Value)%>" size="50" maxlength="100"> </td> </tr> <tr> <td>Tipo de Cadastro:</td> <td><input name="tipocadastro" type="text" id="tipocadastro" value="<%=(vercurriculo.Fields.Item("tip_cadastro").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>E-Mail:</td> <td><input name="email" type="text" id="email" value="<%=(vercurriculo.Fields.Item("e_mail").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Sexo:</td> <td><input name="sexo" type="text" id="sexo" value="<%=(vercurriculo.Fields.Item("sex_o").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Data de Nascimento:</td> <td><input name="dia" type="text" id="dia" value="<%=(vercurriculo.Fields.Item("dia_nascim").Value)%>" size="3" maxlength="02"> <input name="mes" type="text" id="mes" value="<%=(vercurriculo.Fields.Item("mes_nascim").Value)%>" size="15" maxlength="10"> <input name="ano" type="text" id="ano" value="<%=(vercurriculo.Fields.Item("ano_nascim").Value)%>" size="8" maxlength="4"> </td> </tr> <tr> <td>Estado Civil:</td> <td><input name="estcivil" type="text" id="estcivil" value="<%=(vercurriculo.Fields.Item("est_civil").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Endereço:</td> <td><input name="endereço" type="text" id="endereço" value="<%=(vercurriculo.Fields.Item("endereç_o").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Bairro:</td> <td><input name="bairro" type="text" id="bairro" value="<%=(vercurriculo.Fields.Item("bairr_o").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Cidade:</td> <td><input name="cidade" type="text" id="cidade" value="<%=(vercurriculo.Fields.Item("cidad_e").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Estado:</td> <td><input name="estado" type="text" id="estado" value="<%=(vercurriculo.Fields.Item("estad_o").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>CEP:</td> <td><input name="cep" type="text" id="cep" value="<%=(vercurriculo.Fields.Item("ce_p").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Identidade:</td> <td><input name="identidade" type="text" id="identidade" value="<%=(vercurriculo.Fields.Item("identidad_e").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>CPF:</td> <td><input name="textfield312" type="text" value="<%=(vercurriculo.Fields.Item("cp_f").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Nacionalidade:</td> <td><input name="nacionalidade" type="text" id="nacionalidade" value="<%=(vercurriculo.Fields.Item("nacionalidad_e").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Tel. Residencial:</td> <td><input name="telresiden" type="text" id="telresiden" value="<%=(vercurriculo.Fields.Item("tel_residencial").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Tel. Celular:</td> <td><input name="telcelular" type="text" id="telcelular" value="<%=(vercurriculo.Fields.Item("tel_celular").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Situação Atual:</td> <td><input name="situacaoatual" type="text" id="situacaoatual" value="<%=(vercurriculo.Fields.Item("sit_atual").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Área de Atuação:</td> <td><input name="atuacao" type="text" id="atuacao" value="<%=(vercurriculo.Fields.Item("are_atuacao").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Mini-Currículo:</td> <td><input name="minicurri" type="text" id="minicurri" value="<%=(vercurriculo.Fields.Item("min_curriculo").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Formação Escolar:</td> <td><input name="formacao" type="text" id="formacao" value="<%=(vercurriculo.Fields.Item("for_escolar").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Lingua Estrangeira:</td> <td><input name="lingua" type="text" id="lingua" value="<%=(vercurriculo.Fields.Item("lin_estrangeira").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Dispon. Período:</td> <td><input name="perido" type="text" id="perido" value="<%=(vercurriculo.Fields.Item("dis_periodo").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Dispon. Viagem:</td> <td><input name="viagem" type="text" id="viagem" value="<%=(vercurriculo.Fields.Item("dis_viagem").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Mudar de Cidade:</td> <td><input name="mudar" type="text" id="mudar" value="<%=(vercurriculo.Fields.Item("dis_cidade").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Possui Filhos:</td> <td><input name="filhos" type="text" id="filhos" value="<%=(vercurriculo.Fields.Item("filho_s").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Possui Veículo:</td> <td><input name="textfield47" type="text" value="<%=(vercurriculo.Fields.Item("veicul_o").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Habilitação:</td> <td><input name="habilitacao" type="text" id="habilitacao" value="<%=(vercurriculo.Fields.Item("habilitaca_o").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Interesse Pessoal:</td> <td><input name="interpessoal" type="text" id="interpessoal" value="<%=(vercurriculo.Fields.Item("int_pessoal").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Saúde:</td> <td><input name="saude" type="text" id="saude" value="<%=(vercurriculo.Fields.Item("saud_e").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Fumante:</td> <td><input name="fumante" type="text" id="fumante" value="<%=(vercurriculo.Fields.Item("fumant_e").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Bebida Alcoólica:</td> <td><input name="bebida" type="text" id="bebida" value="<%=(vercurriculo.Fields.Item("beb_alcoo").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Como conheceu o Site:</td> <td><input name="conhecesite" type="text" id="conhecesite" value="<%=(vercurriculo.Fields.Item("con_site").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Deficiência fisica:</td> <td><input name="deficiencia" type="text" id="deficiencia" value="<%=(vercurriculo.Fields.Item("def_fisico").Value)%>" size="50" maxlength="100"></td> </tr> <tr> <td>Plano escolhido:</td> <td><input name="plano" type="text" id="plano" value="<%=(vercurriculo.Fields.Item("pla_escolhido").Value)%>" size="50" maxlength="100"></td> </tr> </table></form><p align="center"> </p><p align="center"> </p></body></html><%vercurriculo.Close();%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tente inserir algo como o código abaixo:<%var vercurriculo = Server.CreateObject("ADODB.Recordset");vercurriculo.ActiveConnection = MM_conn_STRING;vercurriculo.Source = "SELECT * FROM Tabela WHERE EMAIL = '"+ vercurriculo__varEmail.replace(/'/g, "''") + "' AND PASSWORD = '"+ vercurriculo__varSenha.replace(/'/g, "''") + "'";vercurriculo.CursorType = 0;vercurriculo.CursorLocation = 2;vercurriculo.LockType = 3;vercurriculo.Open();var vercurriculo_numRows = 0;%>no lugar do seu seguinte código:<%var vercurriculo = Server.CreateObject("ADODB.Recordset");vercurriculo.ActiveConnection = MM_Vanguarda_STRING;vercurriculo.Source = "SELECT * FROM dbo.Cad_Curriculo WHERE e_mail LIKE '"+ vercurriculo__varemail.replace(/'/g, "''") + "' AND senh_a LIKE '"+ vercurriculo__varsenha.replace(/'/g, "''") + "'";vercurriculo.CursorType = 0;vercurriculo.CursorLocation = 2;vercurriculo.LockType = 1;vercurriculo.Open();var vercurriculo_numRows = 0;%><% var MM_paramName = ""; %><% tomando o cuidado de mudar as variáveis para o seu caso.

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.