Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website Design Forum


You are currently viewing our Website Design Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 01-11-2007, 02:02 PM Visitor's IP - Php
Junior Talker

Posts: 18
Trades: 0
This is a more copy-paste than read tutorial, but ah whatever. To do this code, your host must support PHP.

To show your visitor's IP, add the following line wherever:

Quote:
<?php $visitorip = $_SERVER['REMOTE_ADDR'];
echo "$visitorip"; ?>
Just paste it where you want it to go. Nothing really to it, just don't remove the "<" and ">", or else it won't work.

:tooth:
James` is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-14-2007, 05:56 AM
imported_babyboy808's Avatar
Junior Talker

Posts: 116
Trades: 0
Hi,

That works well for a few cases, but what if the user is behind a proxy?

You can use a conditional statement that will check as shown below:
PHP Code:
<?php
if(isset($HTTP_X_FORWARDED_FOR))  // is the HTTP_X_FORWARDED_FOR variable defined already?
{
    if (
$HTTP_X_FORWARDED_FOR)    // A proxy WAS detected..
        
{
     
?>
     Proxy Detected.
                Your actual IP address: <?= $HTTP_X_FORWARDED_FOR ?>
     Your Proxy Server: <?= $HTTP_VIA ?>
                Your Proxy I.P address: <?= $REMOTE_ADDR ?>
     <?
        
}
}
else   
// no proxy was detected
    
{
        
?>
        NO Proxy detected - Your Actual IP is: <?= $REMOTE_ADDR ?>
        <?
    
}
?>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
imported_babyboy808 is offline
Reply With Quote
View Public Profile
 
Old 01-14-2007, 10:05 AM
GeorgeB
Guest

Posts: n/a
Trades:
good point babyboy. Nice code.
Reply With Quote
 
Old 01-18-2007, 07:27 PM
PBS
Junior Talker

Posts: 2
Trades: 0
Interesting script but it is good to know that HTTP header variable X_FORWARDED_FOR might help only if visitor is behind transparent (non anonymous proxy server).
If visitor use real anonymous proxy server then the ip address can not be determined.
However anonymous proxy can be identify because usually anonymous proxy server have HTTP_VIA or PROXY_CONNECTION variable.
If visitor use so called High anonymous proxy (elite server or Level 1) you will not be able to identify proxy because it does not send any of proxy variables and it looks as visitor does not use proxy at all.
High anonymous proxy could be traced only through analyzing of proxy ports.
PBS is offline
Reply With Quote
View Public Profile Visit PBS's homepage!
 
Reply     « Reply to Visitor's IP - Php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28715 seconds with 12 queries