Valuate Domain Names
DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars
HomeRegisterMembershipsGetting StartedDomain Tools Domain EbooksSEO Software Domain Resellers Advertise

Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Content Development > Website Development and Design Discussion > Coding/Programming/Languages
Register Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old 01-25-2005, 01:50 PM   #1 (permalink)
Gold Lifetime Member
 
BigPete's Avatar
 
Last Online: 08-03-2009 08:47 AM
iTrader: (0)
Join Date: Nov 2004
Posts: 91
DNF$: 219
Location: Pennsylvania, USA
Country:


Auth_user

I'm trying to use Request.ServerVariables("AUTH_USER") to write the user name of the visitor on my page. The visitor had to input a username and password to gain access to the page. But the value for the auth user variable always comes up empty. What do I need to do to make this code give me the visitor's username?
Code:
<% 
Response.Write "Hello" & Request.ServerVariables("AUTH_USER")
%>
BigPete is offline   Reply With Quote
Sponsored Ads
Old 01-25-2005, 02:53 PM   #2 (permalink)
DNF Member
No Avatar
 
Last Online: 11-02-2009 04:08 PM
iTrader: (4)
Join Date: Jan 2005
Posts: 126
DNF$: 2,797


Re: Auth_user

I'd think you'de write their username in a cookie and write the cookie to the page...

Response.Write("Hello" & Request.Cookies("MyUsername"))

I haven't done windows validation though, so if htat's what oyu're trying to do I guess my method would be off.

Quote:
Originally Posted by BigPete
I'm trying to use Request.ServerVariables("AUTH_USER") to write the user name of the visitor on my page. The visitor had to input a username and password to gain access to the page. But the value for the auth user variable always comes up empty. What do I need to do to make this code give me the visitor's username?
Code:
<% 
Response.Write "Hello" & Request.ServerVariables("AUTH_USER")
%>
__________________
Mike Bell
Free Image Hosting
Free Adult Image Hosting
Mike Bell is offline   Reply With Quote
Old 01-25-2005, 03:42 PM   #3 (permalink)
Gold Lifetime Member
 
BigPete's Avatar
 
Last Online: 08-03-2009 08:47 AM
iTrader: (0)
Join Date: Nov 2004
Posts: 91
DNF$: 219
Location: Pennsylvania, USA
Country:


Re: Auth_user

well I can write their name easily enough by using
Code:
<%
Response.Write "Hello" & Request.Form("username")
%>
But the request.form only goes so far, and I would like to use AUTH_USER (or something similar that you may know of) for filtering purposes in a Database.
Code:
SELECT * from TABLE WHERE columnname = USER
BigPete is offline   Reply With Quote
Old 01-25-2005, 03:59 PM   #4 (permalink)
DNF Member
No Avatar
 
Last Online: 11-02-2009 04:08 PM
iTrader: (4)
Join Date: Jan 2005
Posts: 126
DNF$: 2,797


Re: Auth_user

If you're not using NT validation, you're not going to get AUTH_USER as far as I know. I know the Request.Form only goes so far. THat's why I'd think once they submit that, you'de write a cookie with that value so you can look it up at any time, and pass it into a stored procedure as a paramater or use it in your ad-hoc. Does that make sense?

Quote:
Originally Posted by BigPete
well I can write their name easily enough by using
Code:
<%
Response.Write "Hello" & Request.Form("username")
%>
But the request.form only goes so far, and I would like to use AUTH_USER (or something similar that you may know of) for filtering purposes in a Database.
Code:
SELECT * from TABLE WHERE columnname = USER
__________________
Mike Bell
Free Image Hosting
Free Adult Image Hosting
Mike Bell is offline   Reply With Quote
Old 01-25-2005, 06:25 PM   #5 (permalink)
Gold Lifetime Member
 
BigPete's Avatar
 
Last Online: 08-03-2009 08:47 AM
iTrader: (0)
Join Date: Nov 2004
Posts: 91
DNF$: 219
Location: Pennsylvania, USA
Country:


Re: Auth_user

are you talking about a session ID? cause i think i tried doing that with my database filter and it didn't work
Code:
session("ID") = Request.Form("username")
...
SELECT * from table WHERE column = session("ID")
BigPete is offline   Reply With Quote
Old 01-26-2005, 12:03 AM   #6 (permalink)
DNF Member
No Avatar
 
Last Online: 11-02-2009 04:08 PM
iTrader: (4)
Join Date: Jan 2005
Posts: 126
DNF$: 2,797


Re: Auth_user

No, not session. Cookie. Unless you're populating that session everytime by making them login every time, you're not going to have their username in the session. most sites write cookies. This is what I'd suggest.

After they log in:
Response.Cookies("Username")=Request.Form("Usernam e")

Then from there on after....
SELECT * from table WHERE column = Request.Cookies("Username")
__________________
Mike Bell
Free Image Hosting
Free Adult Image Hosting
Mike Bell is offline   Reply With Quote
Old 01-26-2005, 08:17 AM   #7 (permalink)
Gold Lifetime Member
 
BigPete's Avatar
 
Last Online: 08-03-2009 08:47 AM
iTrader: (0)
Join Date: Nov 2004
Posts: 91
DNF$: 219
Location: Pennsylvania, USA
Country:


Re: Auth_user

alright, i'll try that
thanks, mike
BigPete is offline   Reply With Quote
Old 01-26-2005, 08:54 AM   #8 (permalink)
DNF Member
No Avatar
 
Last Online: 11-02-2009 04:08 PM
iTrader: (4)
Join Date: Jan 2005
Posts: 126
DNF$: 2,797


Re: Auth_user

No problem. Good luck!
__________________
Mike Bell
Free Image Hosting
Free Adult Image Hosting
Mike Bell is offline   Reply With Quote
Old 01-27-2005, 06:22 PM   #9 (permalink)
Gold Lifetime Member
 
BigPete's Avatar
 
Last Online: 08-03-2009 08:47 AM
iTrader: (0)
Join Date: Nov 2004
Posts: 91
DNF$: 219
Location: Pennsylvania, USA
Country:


Re: Auth_user

hmmm . . . problem here. Using a cookie to filter my database doesn't seem to be working. I get an ASP error message that says:
Code:
Microsoft JET Database Engine error '80040e14'

Undefined function 'Request.Cookies' in expression.
BigPete is offline   Reply With Quote
Old 01-27-2005, 11:33 PM   #10 (permalink)
DNF Member
No Avatar
 
Last Online: 11-02-2009 04:08 PM
iTrader: (4)
Join Date: Jan 2005
Posts: 126
DNF$: 2,797


Re: Auth_user

Your asp page should read like:

Code:
strSQL = "SELECT * from table WHERE column = '" & Request.Cookies("Username") & "'"
__________________
Mike Bell
Free Image Hosting
Free Adult Image Hosting
Mike Bell is offline   Reply With Quote
Old 01-28-2005, 11:14 AM   #11 (permalink)
Gold Lifetime Member
 
BigPete's Avatar
 
Last Online: 08-03-2009 08:47 AM
iTrader: (0)
Join Date: Nov 2004
Posts: 91
DNF$: 219
Location: Pennsylvania, USA
Country:


Re: Auth_user

oh good! that works. I was using
Code:
DB.Open "SELECT * from table WHERE column = Request.Cookies('Username')"
thank you again Mike.
BigPete is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:49 AM.
Copyright @2001-2009 DNForum.com