Geeks Talk

Prepare for your Next Interview




IP address

This is a discussion on IP address within the PHP forums, part of the Web Development category; I want to get ip address. How can I get it or what functions or methods can be used to get ip address using PHP Timmy...


Go Back   Geeks Talk > Web Development > PHP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-22-2006
Contributing Member
 
Join Date: May 2006
Posts: 84
Thanks: 0
Thanked 9 Times in 6 Posts
timmy is on a distinguished road
IP address

I want to get ip address. How can I get it or what functions or methods can be used to get ip address using PHP

Timmy
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-22-2006
Contributing Member
 
Join Date: May 2006
Posts: 88
Thanks: 0
Thanked 8 Times in 8 Posts
norman is on a distinguished road
Re: IP address

You can use REMOTE_ADDR or REMOTE_HOST to achieve the above that is get ip address. But I want to know about super global variables in php. Someone throw highlight on this.
Reply With Quote
  #3 (permalink)  
Old 06-19-2008
Junior Member
 
Join Date: Nov 2007
Location: chennai
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
dhanasekaran07 is on a distinguished road
Re: IP address

$_SERVER variable are super global variable in php....
Reply With Quote
  #4 (permalink)  
Old 09-04-2008
Junior Member
 
Join Date: Aug 2007
Location: surat
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Niyati_1984 is on a distinguished road
Re: IP address

Remote_addr
Reply With Quote
  #5 (permalink)  
Old 4 Weeks Ago
Junior Member
 
Join Date: Sep 2008
Location: Rajkot
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
baria mahesh is on a distinguished road
Arrow Re: IP address

baria Mahesh::
you will use this code for getting ip address which is given below::
<?php
$ip = gethostbyname('www . example . com');
$out = "The following URLs are equivalent:<br />\n";
$out .= '[[siteurl]], http://' . $ip . '/, and http://' . sprintf("%u", ip2long($ip)) . "/<br />\n";
echo $out;
?>

ip2long() function given to you ip address or particular given hostname.
Reply With Quote
Reply

  Geeks Talk > Web Development > PHP


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
RAM Size in Solaris Server blenda Unix/Linux 3 2 Weeks Ago 12:58 AM


All times are GMT -4. The time now is 08:34 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved