Jump to content


Photo

maybe easy, maybe hard...


  • Please log in to reply
2 replies to this topic

#1 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 12 June 2006 - 01:09 PM

Question:

Is there a way in PHP to enter a url and get an IP back?

IE, if I enter www.google.com, I get back 1.2.3.4 or whatever...

Or, does that require rwhois or simular?

I just want to log what IP i'm on (I have dynamic ip) when I do a certain function...



#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 12 June 2006 - 01:17 PM

Take a look at the [a href=\"http://www.php.net/gethostbyname\" target=\"_blank\"]gethostbyname()[/a] function.

Ken

#3 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 12 June 2006 - 01:20 PM

from php.net

Example 1. A simple gethostbyname() example
<?php
$ip = gethostbyname('www.example.com');

echo $ip;
?> 

z..z..z..z..z..z..z..z..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users