Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Frontpage Newsgroups
Frontpage Programming
Capture User Names in Web Forms?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Stefan B Rusynko, post: 3970455"] Create a hidden form field in your form as say: <input type ="hidden" name="UserName" value ="<%=Request.ServerVariables("AUTH_USER") %>"> Note - depending on your server security setup for authentication you may need to try Request.ServerVariables("LOGON_USER") See [URL]http://www.devguru.com/Technologies/asp/quickref/request_servervariables.html[/URL] And then add that new field (UserName) to your strSQL statement list of variables/values PS You really should not be using the global Request (inefficient and open the page to sql injection) as just: request("FormFieldName") - but instead should be using: Request.Form("FormFieldName") for all your form fields See [URL]http://www.devguru.com/Technologies/asp/quickref/request.html[/URL] -- _____________________________________________ SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] "Warning - Using the F1 Key will not break anything!" (-; _____________________________________________ I have anonymous web browsing turned off on my subweb where I keep my webforms. Using FrontPage we have been able to capture the User Name of our users whenever they submit anything via these forms. They've transitioned us from FrontPage to SharePoint Designer now and the ASP.NET services just aren't working on my server. Consequently I am building my forms in ASP. How do I capture those user names if this is my code presently: <%@ Language = "VBScript"%> <% 'Declare all local variables dim conn dim rs dim strconn dim strsql strsql = "" 'set connection string to local variable-I use a DSN-less connection strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("fpdb/Evaluation.mdb") 'build the sql statement based on the input from the form strSQL = "INSERT INTO Results(Supervisor, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10) Values('" & request("Supervisor") & "', '" & request("Q1") & "', '" & request("Q2") & "', '" & request("Q3") & "', '" & request("Q4") & "', '" & request("Q5") & "', '" & request("Q6") & "', '" & request("Q7) & "', '" & request("Q8") & "', '" & request("Q9") & "', '" & request("Q10") & "')" 'Set connection object set conn = server.createobject("adodb.connection") conn.open strconn 'Use the execute method of the connection object the insert the record conn.execute(strSQL) conn.close set conn = nothing %> Somethign to do with this, I'm sure: Request.ServerVariables("User_name") [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Frontpage Newsgroups
Frontpage Programming
Capture User Names in Web Forms?
Top