Discussion Locked

help in asp

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i waant to create a login page in asp. the page will have a login name and password. when a operator types the username and password . when the operator takes an order from the cutomer the login name should appear automatically in the order form( the orderform is already created) . if the customer makes a compliant .inthe complaint form also the login name of the operator
should appear auomatically
reply soon

6 replies

by me

>> i waant to create a login page in asp.
>> the page will have a login name and
>> password.

You could refer to article entitled "Creating a Database-Driven Login Page" at
http://www.4guysfromrolla.com/webtech/021600-1.shtml

>> whena operator types the username and
>> password . when the operator takes an
>> order from the cutomer the login name
>> should appear automatically in the order
>> form( the orderform is already created) .
>> if the customer makes a compliant .inthe
>> complaint form also the login name of the
>> operator should appear auomatically
>> reply soon

when your system has authenticated a user using the sample code in that website, you need to assign the UserName value to session variable, e.g

<%
session("username") = strUsername
%>

after that to display the session("username") value on any pages later, you use:

<%
response.write "your username is: " & session("username")
%>

Hope that may help.

Hadzramin

by andrew

Using session variables is an easy technique, but you should be aware that it does not scale.

If you're not prepared to use a scalable state management system (storing data in a common database), there are 3 other methods open to you:

1: Cookies. You could set a cookie on the client that contains the current UserName.
<%Response.Cookies("UserName")=username%>

2: QueryString. You can pass the current UserName (or ID to save space) back to the server when new pages are requested.
method=get>

3: Hidden Form Field. Store the UserName in a hidden text field, and when the form is posted, the next asp page can pick up the value if necessary.

Depending on the needs of your app (number of users, forms, transactions) you have 4 methods to choose from.

Good luck.

This discussion is closed to new replies.