Grabbing IP adres from ASP webform

Discussion in 'ASP General' started by Kris, Aug 26, 2004.

  1. Kris

    Kris Guest

    Dear all,

    I know this question has been discussed in another topic but I feel
    that I lack a little bit of knowledge to grasp what was said there.
    My problem is as follows :

    As a trainer in a company, I launched a webform asking people to log
    in before they can access the needed training. Nothing fancy and just
    there for monitoring who comes in and when. Problem is that some
    "nice-guys" enter who knows what - because that's fun. Can I
    counteract this by having the ASP form sending me also the IP address
    from the PC ? And where do I have to add these lines ?

    This is the code I use in my ASP form :

    <%
    Dim MyBody
    Dim MyCDONTSMail
    Dim Name
    Dim Team
    Dim Subject
    Dim Comment
    %>
    <%
    Name = Request.Form("Name")
    Team = Request.Form("Team")
    Subject = Request.Form("Subject")
    Comment = Request.Form("Comment")
    %>
    <%
    Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    MyCDONTSMail.From= "XX@xx"
    MyCDONTSMail.To= "xx@xx"
    MyCDONTSMail.Subject="xxxxxxxx"
    Mybody = "This mail has been sent by the automated customer
    feedback engine" & vbCrlF
    Mybody = Mybody & "Please find enclosed the data as filled in" &
    vbCrlF & vbCrlF
    MyBody = MyBody & "Name: " & Name & vbCrlF
    MyBody = MyBody & "Team: " & Team & vbCrlF
    MyBody = MyBody & "Subject: " & Subject & vbCrlF
    MyBody = MyBody & "Comment: " & Comment & vbCrlF & vbCrlF &
    vbCrlF
    MyCDONTSMail.Body= MyBody
    MyCDONTSMail.Send
    Response.Write "Thank you, " & Name & ", for following the
    WebTraining."
    Response.Redirect("xxx.htm")
    set MyCDONTSMail=nothing
    %>

    All help is highly appreciated. Please do understand that I'm new at
    this ASP thing and that it might take some time for me to understand.

    Br,

    Kris
     
    Kris, Aug 26, 2004
    #1
    1. Advertising

  2. Kris

    Evertjan. Guest

    Kris wrote on 26 aug 2004 in microsoft.public.inetserver.asp.general:
    > Can I
    > counteract this by having the ASP form sending me also the IP address
    > from the PC ?


    No, because an IP address does not belong to a pc.

    If you catch the IP by request.servervariables("remote_addr"):

    You could get the clients isp connection IP adress, which is constant in
    some cases, semiconstant in others and changing at every dial in in others
    again.

    Some isps have one IP addres for thousends of clients/surfers at one time.

    Some/many? clients use a proxi, masking their "own" ip.

    Clients on a LAN translate/mask their local ip to a common ip of the
    connection, which again is subject to all the above.

    On top of that all, hackers have found ways to "spoof" ips.

    So yes you can "counteract", but not allways.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
     
    Evertjan., Aug 26, 2004
    #2
    1. Advertising

  3. Kris

    Kris Guest

    Agreed ... that might be the case but the problem is not of that size.
    What is happening is that some users are logging by typing in other
    users names ... if I could "grab" the IP adres from the PC they are
    logging in from, I would be able to see who and what.

    Anybody having a great idea and euh ... feel free to modify my code.

    Br,

    Kris
     
    Kris, Aug 26, 2004
    #3
  4. Kris

    Jeff Dillon Guest

    As stated, request.servervariables("remote_addr") is your only bet

    Jeff

    "Kris" <> wrote in message
    news:...
    > Agreed ... that might be the case but the problem is not of that size.
    > What is happening is that some users are logging by typing in other
    > users names ... if I could "grab" the IP adres from the PC they are
    > logging in from, I would be able to see who and what.
    >
    > Anybody having a great idea and euh ... feel free to modify my code.
    >
    > Br,
    >
    > Kris
     
    Jeff Dillon, Aug 26, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. titof
    Replies:
    0
    Views:
    539
    titof
    Jul 24, 2003
  2. timmso
    Replies:
    1
    Views:
    533
    Alex Papadimoulis
    Dec 12, 2003
  3. =?Utf-8?B?bXN1aw==?=

    Using one webform to set a value on another webform

    =?Utf-8?B?bXN1aw==?=, Jul 12, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    496
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 12, 2006
  4. =?Utf-8?B?Vk1J?=

    Moving value from popup Webform to main Webform?

    =?Utf-8?B?Vk1J?=, Oct 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    595
    GroupReader
    Oct 9, 2006
  5. Luqman
    Replies:
    2
    Views:
    679
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Apr 11, 2007
Loading...

Share This Page