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!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") %>
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.
Originally Posted by BigPete
well I can write their name easily enough by using
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:<% Response.Write "Hello" & Request.Form("username") %>
Code:SELECT * from TABLE WHERE columnname = 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?
Originally Posted by BigPete
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")
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")
alright, i'll try that
thanks, mike
No problem. Good luck!![]()
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.
Your asp page should read like:
Code:strSQL = "SELECT * from table WHERE column = '" & Request.Cookies("Username") & "'"
oh good! that works. I was using
thank you again Mike.Code:DB.Open "SELECT * from table WHERE column = Request.Cookies('Username')"
Bookmarks