hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Showing IP# on a web page
Reply

Forum Jump

Showing IP# on a web page

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 04-26-2004, 02:40 PM
ChowSumDung ChowSumDung is offline
WHT Addict
 
Join Date: Mar 2002
Posts: 156
Question

Showing IP# on a web page


How do you show the visitor's IP# or remote host information on a web page? I'd like to have this shown on my feedback form page (so the visitor can see his/her IP#) and have this sent out via email to me.

I see these on many sites, but never figured out how.

__________________
"It does not matter how slowly you go, so long as you do not stop." – Confucius



Sponsored Links
  #2  
Old 04-26-2004, 02:44 PM
Allwin A Allwin A is offline
Junior Guru
 
Join Date: Aug 2002
Posts: 183
In php, you can do it in the following ways :

Code:
<?php 
echo "Remote Address: ", $_SERVER['REMOTE_ADDR']; // displays the remote ip address. 
echo "<br />"; // html tag break line which is included inside the php code. 
echo "Server Address: ", $_SERVER['SERVER_ADDR']; // displays the server ip address. 
?> 

<?php 
echo "Remote Address: ", getenv("REMOTE_ADDR"); // displays the remote ip address. 
echo "<br />"; // html tag break line which is included inside the php code. 
echo "Server Address: ", $serverip = getenv("SERVER_ADDR"); // displays the server ip address. 
?> 

<?php 
echo "Remote Address: ", $_SERVER['REMOTE_ADDR']; // displays the remote ip address. 
echo "<br />"; // html tag break line which is included inside the php code. 
echo "Server Address: ", $_SERVER['SERVER_ADDR']; // displays the server ip address. 
?> 

<?php 
echo "Remote Address: ", getenv("REMOTE_ADDR"); // displays the remote ip address. 
echo "<br />"; // html tag break line which is included inside the php code. 
echo "Server Address: ", $serverip = getenv("SERVER_ADDR"); // displays the server ip address. 
?>

  #3  
Old 04-29-2004, 01:19 AM
Brightadmin Brightadmin is offline
Web Hosting Master
 
Join Date: Feb 2004
Posts: 772
Hi,

Using PHP you can display IP (REMOTE_ADDR).

<?
$hst = $_SERVER["HTTP_HOST"];
$uri = $_SERVER["REQUEST_URI"];
$rmt = $_SERVER["REMOTE_ADDR"];
$br = $_SERVER["HTTP_USER_AGENT"];
echo "Your IP address reflects as : $rmt \n<br>\n The page you requested was: $uri \n<br>\n The browser you are using is $br";
?>

Regards,

Bright
24 /7 Technical Support

__________________
Bright Info Solutions

Sponsored Links
Reply

Related posts from TheWhir.com
Title Type Date Posted
Lance Crosby Lends His Voice to IBM Cloud Commercial Blog 2014-04-14 15:11:29
Ads Available for the Second Printing of WHIR’s Annual Hottest Hosts Directory Blog 2014-04-08 16:52:36
HOSTING Storage Failure Affects CloudVPS Accounts Web Hosting News 2013-10-23 11:51:43
Page.ly Grows Managed WordPress Hosting Platform with BlogDroid Acquisition Web Hosting News 2013-06-27 15:43:37
Why You Should Embrace Google Plus Blog 2013-03-08 09:18:17


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?