Results 1 to 6 of 6

Thread: ASP to display IP Address on Website

  1. #1
    Join Date
    Nov 2009
    Posts
    68

    ASP to display IP Address on Website

    Hello to everyone. I am going to develop a website for a Tourism office as a project for my academic last year. I wanted to know that is it really possible to display to the viewer his/her IP address if they access my website? I am using ASP to develop the website. So if it is possible then can any provide a solution as to how can I displays the visitor's IP address?

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    UserHostAddress() function to display IP Address

    Yes, it is possible to display the IP-Address of the visitors to the website using ASP. ASP has a UserHostAddress() function which can be used to get the IP Address of the visitor. I have used the same in my project as well. Try the following code and see if the IP-Address of the visitor is displayed:
    Code:
    Dim strvisitip As String
    strvisitip = Request.UserHostAddress()
    Response.Write(strvisitip)

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: ASP to display IP Address on Website

    The ASP language is very useful to design a website. You can make use of the ASP Script to output the internet address (also known as IP Address) of the website's visitor on your own website. Here is an ASP script that will help you to display the internet address of your website's visitor's:
    Code:
    <%
    ipaddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
    Response.Write("Internet Address is as follows: ")
    Response.Write(ipaddr)
    %>

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    Re: ASP to display IP Address on Website

    I have also worked on a website project recently and I had to learn ASP before working on it. We also had our website displaying the user's IP Address. We also used the ASP language to develop our website. Incase you simply just need to display the IP Address of the user then use the following ASP code:
    Code:
    Response.Write(Request.Servervariables("REMOTE_ADDR"))

  5. #5
    Join Date
    May 2008
    Posts
    2,012

    PHP to display IP Address on Website

    Code:
    Function ipclent()
    ipclent = Request.ServerVariables ( "HTTP_X_FORWARDED_FOR" )
    If ipclent = "" Then
    ipclent  = Request.ServerVariables ( "REMOTE_ADDR" )
    End if
    End Function
    The above code will help you to get the IP address of the client visiting the web page. The Function ipclent() will help you to notice of the client is making use of any proxy server or not. I want to know the code to get the date and time on my website.

  6. #6
    Join Date
    Aug 2009
    Posts
    155

    Re: ASP to display IP Address on Website

    I have made use of the following ASP Script code to display the date and time on the website that I worked on.
    Code:
    Today's Date is: <%= Date() %> 
    <BR>
    The Time now is <%= Time() %>
    This will display the current date as well as time to the user. Use this code in your date and time file and apply it in your ASP programming code. You can also display messages such as the following code:
    <%
    Dim hr
    hr = Hour(Now)
    If hr < 12 Then
    Response.Write "A Very Good Morning"
    ElseIf hr < 17 Then
    Response.Write "A Very Good afternoon!"
    Else
    Response.Write "A Very Good evening!"
    End If
    %>

Similar Threads

  1. How to open the website by using the IP address?
    By AlandraJ in forum Technology & Internet
    Replies: 6
    Last Post: 30-12-2011, 10:24 PM
  2. Website address of the Indian universities
    By P-chuha in forum Education Career and Job Discussions
    Replies: 1
    Last Post: 16-11-2010, 07:25 PM
  3. Replies: 1
    Last Post: 06-02-2010, 09:40 PM
  4. How to find IP address of a website visitor
    By Bilal in forum Technology & Internet
    Replies: 2
    Last Post: 07-05-2009, 03:17 PM
  5. display and Red Cross problem on website
    By Bhuvan in forum Monitor & Video Cards
    Replies: 3
    Last Post: 28-03-2009, 08:16 PM

Tags for this Thread

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
  •  
Page generated in 1,714,032,115.39729 seconds with 17 queries