Click here to Skip to main content
16,004,893 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi i m developing a website which have two kind of user login categories first called publisher and second called advertiser.publisher user login via <authentication> section.
<authentication> section does not allow 2 users authentication but i used request.querystring for advertiser user but now the problem is that i can't use user.identity.name
i have many pages links<a href="#"> in my website homepage.for going to other pages needs user ID along with href tag

plase tell me Is this way right or wrong
and what is the best solution


regard's
Posted
Updated 3-Jan-10 9:32am
v2

1 solution

well the best solution according to my knowledge would be a database with a table for your users or 2 tables called publishers and advertisers

then uses a sql query to get a record from the database if the user logged in using the correct name and password

and if the password or user name is incorrect display a message.

then create a session variable for your user name and password and check it on every page. this eliminates the parameters in the URL using your links

example of the query
 Dim username 
 Dim password
 Dim nConn

 Password = Request.Form("txtNPassword")
 username = Request.Form("txtUsername")

 UserQuery = "Select * from table where columnname = '"+ username + "' and passwordcolumn = '"+ password + "'"

Set lRS = CreateObject("ADODB.RECORDSET")
 lRS.Open UserQuery, lConn


the last 2 lines creates the record set you can use for checking if there is a record selected
you just need to create a connection to the database first
if you checked that there is variables then you can create session variables using this
session("SUsername") = Request.Form("txtUsername")
session("SPassword") = Request.Form("txtPassword")
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900