No Renze,
        what I really want is in the calling php file itself I want to get the IP

Say some test.php..I call this file like

I want to get in test.php file itself.

I think parse_url will help me. But I don't know how to pass the current URL
itself to test.php file.

Thanks in advance

-----Original Message-----
From: * R&zE: [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 3:13 PM
To: Balaji Ankem
Subject: IP <-> URL

Hi there,

I just found out I probably sent you the wrong answer to your
question. What I sent you was how to get the IP-address of the user
of your website. But you want to get the IP-address of some URL? So
you want the IP of a website?
I think it should be something like:

if (preg_match ("#^([^:]*://){0,1}[^/]+#", $the_url, $matches)) {
  $base_url = $matches[1];
  $the_ip = gethostbyname($base_url);
} else {
  // Oops... no base URL!
---[end of php-code]---

I must tell you, though, that I just typed this in this email. I
have never use this, and I haven't tested this. So it might need
some finetuning and stuff. But I guess it's a good start for solving
your problem.

Let me know...


* R&zE:

-- Renze Munnik
-- DataLink BV
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands


Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to