• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

Login and password dialog

I want to use dialog for login and password in asp.How i can do it.
0
malik_mumtaz
Asked:
malik_mumtaz
1 Solution
 
xabiCommented:
Hi there:

You must create an login page with a form where you must ask for the login an the password:

..
..
<form name="myform" action="login2.asp" method="post">
Login:<input type="text" name="login">
<br>
Pass:<input type="password" name="password">
</form>
..
..


Then you must create a page "login2.asp" where you must get the values submitted from the previous page this way:

..
..
<%
login=request.form("login")
password=request.form("password")
%>
..
..

now you have the values of the login and password and you must check is this values are correct (using a database query or simply checking this values with a predefined values. If the values passwed are oke then make something like this:

..
..
if login="my_user" and password="my_password" then
  session("user_logged")="ok"
  response.redirect("first_page.asp")
else
  session("user_logged")="no"
  response.redirect("error.asp")
end
..
..

This will redirect to the right page depending on the correct values. In every page you must first chec if the user is logged this way:

..
..
is session("user_logged")<>"ok" then
  response.redirect("login.asp")
end if
..
..

If you have any problem just ask

xabi
0
 
malik_mumtazAuthor Commented:
Sorry I have used this technique but
I want to call browser authentication dialog.
0
 
robbertCommented:
Under Windows NT, in Windows Explorer, right-click at the file or directory you want to protect. Select Security, Permissions. Delete User "Everyone", and select the user you want to allow access. Give him the right to "read" or whatever is useful.

Before, possibly create that user in the User Manager.

Under Unix, there is a .htaccess file, but I don't know what to do there.

- But I assume, your site is hosted by an external provider. So tell them which directory to protect, and which name and password to use. If you're paying enough money, he will follow your command ;-)
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
jamestthomasCommented:
Set your website security to windows NT challenge and response.  That will open a dialog box for login when someone attempts to access your site.  Put the users you want to have access to the site in a local group which has permissions to access the site (in user manager for domains).  When the challenge and response diaplog box appears, the user will have to add an ID and password for a user you have specifically put in that group or else they will not be allowed in the site.  Further help is available on the microsoft site, look up IIS security and challenge and response.
0
 
malik_mumtazAuthor Commented:
I have a database.Where user are added
by registration online.I want to call win NT security dialog through asp pages.It is possible or not.
0
 
jamestthomasCommented:
Those people can register on line but they still must be placed into the group allowed access to the site in order for my answer to be applicable.
If you are talking registering and immediate access, you will want to use Microsoft Site Server.  That product is designed for allowing registered users into a particular site.
0
 
malik_mumtazAuthor Commented:
Please explain about site server.
0
 
jamestthomasCommented:
Microsoft Site Server is a large E commerce product produced to help companies offer sites that allow for registration of users online.  It also granulates user levels of authority so that users can opt for certain levels of membership and this level is enforced within the site.  It essentially works with SQL server which is not recommended to be installed on the same machine as the server.  Microsoft will have alot of literature online about it so I would recommend going their and doing research.  It is a complicated product but very powerful.  If you are in need of what it offers, it can be great.  
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now