通过从两个表中获取登录名和密码来登录.

编程入门 行业动态 更新时间:2024-10-26 22:26:35
本文介绍了通过从两个表中获取登录名和密码来登录.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有两个表..一个表用于公民,一个表用于staton ..我有一个loginin页面,其中包含用户名和密码字段.如果市民登录,他将转到他的页面.如果电台登录,他会转到他的页面. 因为市民和车站的桌子不同.因此,公民和站点用户的登录名和密码位于不同的表中. 如何查询,以便该系统将检查公民和车站的登录名和密码以将其重定向到那里的页面. 如何使用选择查询..

i have two tables .. one table is for citizen and one table is for staton.. i have one loginin page having fields for username and password. if citizen logs in he will go to his page. and if station logs in he goes to his page.. as table for citizen and stations are different . so login and password for citizen and station users are in diffent tables. how to query so that that system will check the login in and password for citizen or station to redirect them to there pages. how to use select query for that..

推荐答案

尝试将两种类型的用户的用户名/密码保存在一个表中.然后在该表中添加一个标志列,以确定用户类型.然后,您只需要查询一个表. Try keeping usernames/passwords of both types of users in one table. And in that table, add a flag column to determine the user type. Then you have to only query one table.

它实际上并不是查询的工作. sql查询将执行类似检查存储的用户名密码所提供的密码的操作. 但是它(sql)不能告诉浏览器重定向到一个页面或另一个页面.它只会获取数据. (根据您的具体情况) 任何重定向都必须在asp中完成 欢呼 布莱斯 well its not really a query''s job. A sql query will do something like check the password supplied against a stored password for a username. But it (sql) wont be able to tell the browser to redirect to one page or another. It will just get data. (in your particular case) Any redirection would have to be done in say asp cheers Bryce

嘿, 将所有用户的用户名/密码保存在一个表中,并增加一列以确定如果admin然后是super以及如果简单用户则是user或其他类型,则是哪种类型的用户. 当用户登录时,请检查UserName和密码以及是哪种类型的用户,并为该类型的用户维护会话,最后在页面加载时检查会话值(如果合适),然后显示页面,否则显示页面,否则重定向到登录页面. 祝你好运. Hey, keep usernames/passwords of all users in one table and add 1 extra column to determine what type of user that is like if admin then super and if simple user then user or whatever that is. when user going log in then check UserName and password and what type of user that is and maintain session for that type of user and finally check session value at page load if appropriate user then show page otherwise redirect to login page. Best Luck.

更多推荐

通过从两个表中获取登录名和密码来登录.

本文发布于:2023-11-06 04:47:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562746.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:登录名   两个   密码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!