# Is this possible

**URL:** <https://forum.kirupa.com/t/is-this-possible/34125>\
**Category:** Uncategorized\
**Created:** [October 28, 2003, 1:49pm UTC](https://forum.kirupa.com/t/is-this-possible/34125 "2003-10-28T13:49:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![evader](https://avatars.discourse-cdn.com/v4/letter/e/e9a140/32.png) [@evader](https://forum.kirupa.com/u/evader)\
**Post date:** [October 28, 2003, 1:49pm UTC](https://forum.kirupa.com/t/is-this-possible/34125/1 "2003-10-28T13:49:41Z")

</div>

I was wondering if there is a code or script someone could post for me that when someone visits a certain page I can have something that displays their ip address, their service provider and what operating system they are using?

Can anyone help me out?

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 28, 2003, 1:59pm UTC](https://forum.kirupa.com/t/is-this-possible/34125/2 "2003-10-28T13:59:40Z")

</div>

Umm… If you ind the ip and you actually know how to subnet through it to find out the ISP… You’ve got a pretty hefty program…

But it’s not likely to happen buddy… 😉

IP-Yes ISP-No OS-Yes.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 28, 2003, 2:05pm UTC](https://forum.kirupa.com/t/is-this-possible/34125/3 "2003-10-28T14:05:09Z")

</div>

there are free tracking services too. All you need to do is put their little icon in the page you want to track and the loading of that icon captures that information and saves it to a table which you can reference from the services main site.

search for trackers on google (or something to that effect) and Im sure you’ll find somehting

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 28, 2003, 2:09pm UTC](https://forum.kirupa.com/t/is-this-possible/34125/4 "2003-10-28T14:09:30Z")

</div>

[http://www.gostats.com](http://www.gostats.com)

it’s a free web counter that records their ip address, browser version, os, etc…

the only thing it doesn’t do really is record the internet service provider…but sometimes you can find out anyway. besides recording their ip address, it also records other information. for instance, if i visited the page it would say something like

mh502002.truman.edu  
150.243.177.84

the top part would tell me the person was from truman state university.

it’s worth a shot 🙂

-teet

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 28, 2003, 2:12pm UTC](https://forum.kirupa.com/t/is-this-possible/34125/5 "2003-10-28T14:12:53Z")

</div>

is there a php tag for that

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 28, 2003, 2:26pm UTC](https://forum.kirupa.com/t/is-this-possible/34125/6 "2003-10-28T14:26:27Z")

</div>

you can get a lot out of what PHP can provide for you by making a php page and calling phpinfo() (in php). That will give you version and environment variables etc - including viewers IP and whatnot.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 28, 2003, 2:39pm UTC](https://forum.kirupa.com/t/is-this-possible/34125/7 "2003-10-28T14:39:23Z")

</div>

didn’t know that it also prints the IP. Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 28, 2003, 2:43pm UTC](https://forum.kirupa.com/t/is-this-possible/34125/8 "2003-10-28T14:43:54Z")

</div>

To get the ISP, you need to do a reverse DNS lookup and then parse the hostname to find the ISP.

To get the OS, you need to look in HTTP\_USER\_AGENT.

Here’s some code to get you started:

```php

<?php
$ipaddr = $_SERVER['REMOTE_ADDR'];
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

$agent = $_SERVER['HTTP_USER_AGENT'];
$platform = 'Unknown OS';
if (eregi("win", $agent)) $platform = "Windows";
elseif (eregi("mac", $agent)) $platform = "Macintosh";
elseif (eregi("linux", $agent)) $platform = "Linux";
elseif (eregi("OS/2", $agent)) $platform = "OS/2";

echo "$ipaddr - $hostname - $platform";
?>

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 28, 2003, 2:49pm UTC](https://forum.kirupa.com/t/is-this-possible/34125/9 "2003-10-28T14:49:00Z")

</div>

thanks, the $\_SERVER[‘REMOTE\_ADDR’] was exactly what I was looking for!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 28, 2003, 3:22pm UTC](https://forum.kirupa.com/t/is-this-possible/34125/10 "2003-10-28T15:22:35Z")

</div>

Kein problem, McG.

Glad I could help.
