Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , , ,

Sponsored Links



ASP to display IP Address on Website

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 04-03-2010
Member
 
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?
Reply With Quote
  #2  
Old 04-03-2010
Praetor's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,937
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)
Reply With Quote
  #3  
Old 04-03-2010
Reegan's Avatar
Member
 
Join Date: Oct 2005
Posts: 2,299
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)
%>
Reply With Quote
  #4  
Old 04-03-2010
MindSpace's Avatar
Member
 
Join Date: Feb 2008
Posts: 1,832
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"))
Reply With Quote
  #5  
Old 04-03-2010
Member
 
Join Date: May 2008
Posts: 1,990
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.
Reply With Quote
  #6  
Old 04-03-2010
Member
 
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:
Quote:
<%
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
%>
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "ASP to display IP Address on Website"
Thread Thread Starter Forum Replies Last Post
How to open the website by using the IP address? AlandraJ Technology & Internet 6 30-12-2011 10:24 PM
Website address of the Indian universities P-chuha Education Career and Job Discussions 1 16-11-2010 07:25 PM
Add a contact folder and display it in the address book wingeek Tips & Tweaks 1 06-02-2010 09:40 PM
How to find IP address of a website visitor Bilal Technology & Internet 2 07-05-2009 04:17 PM
display and Red Cross problem on website Bhuvan Monitor & Video Cards 3 28-03-2009 09:16 PM


All times are GMT +5.5. The time now is 11:33 AM.