adding username from a login script to webpage.

G

Guest

Hello I currently use the asp login script from webwiz but I am having problems adding the username of whomever is logged in to an html page. On the page immediately after login there is the following script---- <
'Dimension Variable
Dim strUserName 'Holds the name of the use

'Get the users name passed from the previous pag
strUserName = Request.QueryString("name"

%
-------- The only problem with this is it only works if the user just came from the login page. If they come back to the page later or browse to another page with this script it doesn't display because they didnt just come from the login page. So I would like to know if anyone knows how to add the username even if they didn't just come from th elogin page something like carrying the variable from page to page. The link for the login script that sets the username variable is at the following address. http://www.roadhousegossip.com/checkuser.txt Thanks for any help or suggestions I am not familiar with asp and this is really bugging me. And the folks at the web wiz forum are not responding to my post there. Again thanks for any help.
 
T

Thomas A. Rowe

Just to be clear, after the user logs in, you want to carry their UserName between pages, and all
pages are within the same subweb and all pages will have .asp extension, correct?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


Matthew said:
Hello I currently use the asp login script from webwiz but I am having problems adding the
username of whomever is logged in to an html page. On the page immediately after login there is the
following script---- <%
'Dimension Variables
Dim strUserName 'Holds the name of the user

'Get the users name passed from the previous page
strUserName = Request.QueryString("name")


%>
-------- The only problem with this is it only works if the user just came from the login page.
If they come back to the page later or browse to another page with this script it doesn't display
because they didnt just come from the login page. So I would like to know if anyone knows how to add
the username even if they didn't just come from th elogin page something like carrying the variable
from page to page. The link for the login script that sets the username variable is at the following
address. http://www.roadhousegossip.com/checkuser.txt Thanks for any help or suggestions I am not
familiar with asp and this is really bugging me. And the folks at the web wiz forum are not
responding to my post there. Again thanks for any help.
 
G

Guest

Yes I would like to carry the username through all the pages and they do have .asp extensions. If it isn't too difficult I would also like to know how to add it to pages in different folders if possible. Thanks Matt
 
T

Thomas A. Rowe

Add/Change the following on checkuser.txt :

'If the password is correct then set the session variable to True
Session("blnIsUserGood") = True
Session("UserName") = strUserName

Make sure you rename checkuser.txt to checkuser..asp and change all links for security.


Now you can then display this User Name on any page by insert the following in HTML / Code view:

<%=Session("UserName")%>

Sessions do not cross subwebs or domains or http or https

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


Matthew said:
Yes I would like to carry the username through all the pages and they do have .asp extensions. If
it isn't too difficult I would also like to know how to add it to pages in different folders if
possible. Thanks Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top