Current location: Hot Scripts Forums » Programming Languages » PHP » Ip of machine on network


Ip of machine on network

Reply
  #1 (permalink)  
Old 04-08-05, 07:51 AM
Sowhat Sowhat is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Ip of machine on network

How can i get the ip address of machine tht are on the network.. i have tried romote address but tht gives the ip of the server to whom i am connected so what happens is all the machines on the network give the same ip using remote address but i want the individual IP of each machine... is this possible?
also is it possible to tracethe machine no of each computer thru PHP.... Please dnt let ur minds turn evil the IP so traced will help me to pass a query tht will restrict the options selected from a single machine
Reply With Quote
  #2 (permalink)  
Old 04-08-05, 01:23 PM
1jetsam 1jetsam is offline
Wannabe Coder
 
Join Date: Apr 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
I'm confused...

I know on my network, my desktop computer can't host or do anything of that sort because the Internal IP Address is way to protected (and it annoys me). However, I can set my labtop computer as a server.
It depends how your network is setup, but you should be able to see the IP Addresses on your Network Places.
Since I have wireless, with microsoft software, it has a special window for showing my IP Address, and also showing all other computers on the network and shows their IP Address: Including my Linux computer.
You are looking for your internal IP Address, not your external IP Address.
__________________
Quate CMS 0.3.3 Released - A simple, fast Content Management System.
Reply With Quote
  #3 (permalink)  
Old 04-08-05, 03:49 PM
bizzar528's Avatar
bizzar528 bizzar528 is offline
Community Liaison
 
Join Date: Sep 2004
Location: Pennsylvania, US
Posts: 1,550
Thanks: 2
Thanked 16 Times in 15 Posts
you'd just have to at least know a little about how your network is set up. Here's some php manual pages about dns lookups in php.

http://us4.php.net/manual/en/function.gethostbyaddr.php (ip to name)
http://us4.php.net/manual/en/function.gethostbyname.php (name to ip)
http://us4.php.net/manual/en/functio...ostbynamel.php (ips by name)
http://us4.php.net/manual/en/function.checkdnsrr.php
http://us4.php.net/manual/en/functio...get-record.php
http://us4.php.net/manual/en/function.getmxrr.php

Keep in mind that the php functions to do this use the dns settings of the server. if the server can't see it, then neither will php.
__________________
Yep, it's a signature...
Reply With Quote
  #4 (permalink)  
Old 04-10-05, 10:48 AM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
in vpn, you're unable to view individual ip. it's because each ip is private and assigned based on "lookup table" in the gateway. anyway, if a client is connected to your server through proxy(ies) and its ip is public, you'll still be able to see the original ip. please look for constants HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP. from this, i'm sure you can find some workaround for the problem.
__________________
just an ignorant noob with moronic solution...
Reply With Quote
  #5 (permalink)  
Old 04-11-05, 01:01 AM
netbakers's Avatar
netbakers netbakers is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Sowhat,

try this one.

Use the following function
PHP Code:

<?php 

function locIp() 


$ip_address=$_SERVER['HTTP_X_FORWARDED_FOR']; 

if (
$ip_address==NULL){ 
$ip_address=$_SERVER[REMOTE_ADDR]; } 
return 
$ip_address


$ip locIp();

echo 
$ip;
?>

here's a little tip in case you are missing it, don't check the script in your local lan. proxy's are normally configured to bypass local lan's so put your code on some remote server and then try it out.

it works perfect for me using firefox, ie, netscape. I am behind squid proxy.

I am not sure about the other proxies.

check this link:

http://www.netbakers.com/ip/
__________________
---------------------------------------------------------

info@netbakers.com

http://www.netbakers.com/

Last edited by netbakers; 04-11-05 at 01:10 AM.
Reply With Quote
  #6 (permalink)  
Old 04-11-05, 07:29 AM
Sowhat Sowhat is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Arrow thnx

hi all,


thnx for showing me some ray of hope !!

will post the results soon
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression IP Address Replacement CMIVXX PHP 3 11-20-04 07:27 AM
New Alternative to WhatIsMyIP for IP checking - FlashMyIP.com akaz The Lounge 0 09-19-04 01:27 PM
p4 2.8 Ghz, 512 RAM, 60 Gb, 500 gb, linux $119, win $159, 100% network uptime guarant digitaloutrage General Advertisements 0 06-14-04 03:36 PM
p4 2.8 Ghz, 512 RAM, 60 Gb, 500 gb, linux $119, win $159, 100% network uptime guarant digitaloutrage General Advertisements 0 05-24-04 12:27 PM
p4 2.8 Ghz, 512 RAM, 60 Gb, 500 gb, linux $119, win $159, 100% network uptime guarant digitaloutrage General Advertisements 0 05-10-04 09:34 AM


All times are GMT -5. The time now is 06:39 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.