Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 11 of 11

Thread: Auth_user

  1. #1
    Gold Lifetime Member
    BigPete's Avatar
    Join Date
    Nov 2004
    Location
    Pennsylvania, USA
    Posts
    79
    DNF$
    389
    Bank
    0
    Total DNF$
    389
    Donate  

    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")
    %>

  2. #2
    DNF Member

    Join Date
    Jan 2005
    Posts
    126
    DNF$
    2,827
    Bank
    0
    Total DNF$
    2,827
    Donate  

    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")
    %>

  3. #3
    Gold Lifetime Member
    BigPete's Avatar
    Join Date
    Nov 2004
    Location
    Pennsylvania, USA
    Posts
    79
    DNF$
    389
    Bank
    0
    Total DNF$
    389
    Donate  

    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

  4. #4
    DNF Member

    Join Date
    Jan 2005
    Posts
    126
    DNF$
    2,827
    Bank
    0
    Total DNF$
    2,827
    Donate  

    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

  5. #5
    Gold Lifetime Member
    BigPete's Avatar
    Join Date
    Nov 2004
    Location
    Pennsylvania, USA
    Posts
    79
    DNF$
    389
    Bank
    0
    Total DNF$
    389
    Donate  

    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")

  6. #6
    DNF Member

    Join Date
    Jan 2005
    Posts
    126
    DNF$
    2,827
    Bank
    0
    Total DNF$
    2,827
    Donate  

    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")

  7. #7
    Gold Lifetime Member
    BigPete's Avatar
    Join Date
    Nov 2004
    Location
    Pennsylvania, USA
    Posts
    79
    DNF$
    389
    Bank
    0
    Total DNF$
    389
    Donate  

    Re: Auth_user

    alright, i'll try that
    thanks, mike

  8. #8
    DNF Member

    Join Date
    Jan 2005
    Posts
    126
    DNF$
    2,827
    Bank
    0
    Total DNF$
    2,827
    Donate  

    Re: Auth_user

    No problem. Good luck!

  9. #9
    Gold Lifetime Member
    BigPete's Avatar
    Join Date
    Nov 2004
    Location
    Pennsylvania, USA
    Posts
    79
    DNF$
    389
    Bank
    0
    Total DNF$
    389
    Donate  

    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.

  10. #10
    DNF Member

    Join Date
    Jan 2005
    Posts
    126
    DNF$
    2,827
    Bank
    0
    Total DNF$
    2,827
    Donate  

    Re: Auth_user

    Your asp page should read like:

    Code:
    strSQL = "SELECT * from table WHERE column = '" & Request.Cookies("Username") & "'"

  11. #11
    Gold Lifetime Member
    BigPete's Avatar
    Join Date
    Nov 2004
    Location
    Pennsylvania, USA
    Posts
    79
    DNF$
    389
    Bank
    0
    Total DNF$
    389
    Donate  

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Domain name forum recommended by Domaining.com