quahog Posted January 8, 2004 Posted January 8, 2004 Can anyone tell me how to get the e-mail address of a user accessing my web page? I know this has been answered a million times but I could not find the answer... Thanks in advance Quote when the day is bad and life's a curse, cheer up tomorrow may be worse.
Moderators Robby Posted January 8, 2004 Moderators Posted January 8, 2004 I don't think you can do this. Quote Visit...Bassic Software
iebidan Posted January 8, 2004 Posted January 8, 2004 You can't get the email of the person visiting your web page, I wouldn't like this, MY PRIVACY IS WORTH SOMETHING, every spammer in the world thought of this idea, but thank God you can't, the only thing that at this time comes to my mind is that you can get the IP of the user, knowing that in this IP 200 other guys or more may be using it too (proxy or firewall). Quote Fat kids are harder to kidnap
samsmithnz Posted January 8, 2004 Posted January 8, 2004 If you really want the email address, make them login to the site with a login that is verified with an email address. Quote Thanks Sam http://www.samsmith.co.nz
quahog Posted January 8, 2004 Author Posted January 8, 2004 Actually, I dug it up. Thanks for the help. I can provide what I found to anyone who is interested. It isn't pretty but it gives me enough of what I need. For the record, I am not a spammer. Samsmithnz - I agree that an extra login would be the right thing but it was something my user was adament against (another password/login to keep track of.) Quote when the day is bad and life's a curse, cheer up tomorrow may be worse.
quahog Posted January 8, 2004 Author Posted January 8, 2004 It is not pretty, but it all I need. I have 2 sets of code that work... Imports System.Web.Security Then code something like this: Sub GetUserID() Dim userID As String Dim strFullName As String strFullName = User.Identity.Name 'GET JUST THE LOGIN ID(REMOVE ANY DOMAIN INFO) userID = strFullName.Substring(strFullName.IndexOf("\", 0) + 1) textBox1.text = userID End Sub **************** Dim user As String = Request.ServerVariables("LOGON_USER") If Len((user)) + 1 = 1 Then Response.Status = "401 unathorized" Response.AddHeader("WWW-Authenticate", "BASIC REALM=You are not authorized to access this resource.") Dim akey As String Response.Write("<h2>All Server Variables</h2>") For Each akey In Request.ServerVariables.Keys Response.Write(akey & "=" & Request.ServerVariables.Item(akey) & "<br>") Next Response.End() Else Dim s As String s = "LOGON_USER=" & Request.ServerVariables("LOGON_USER") & "<br>" s += "AUTH_USER=" & Request.ServerVariables("AUTH_USER") & "<br>" s += "AUTH_PASSWORD=" & Request.ServerVariables("AUTH_PASSWORD") & "<br>" Me.lblresult.Text = s End If Quote when the day is bad and life's a curse, cheer up tomorrow may be worse.
Administrators PlausiblyDamp Posted January 8, 2004 Administrators Posted January 8, 2004 Got to ask but why do you need their e-mail if you are running within a domain? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
vbFace Posted January 8, 2004 Posted January 8, 2004 Where in that code is it getting an e-mail address? All it seems to be getting is a logon name. Quote
samsmithnz Posted January 8, 2004 Posted January 8, 2004 was the question supposed to be "How do i get the logged in user for the person accessing my web page?" ??? Quote Thanks Sam http://www.samsmith.co.nz
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.