Greenguy's Board


Go Back   Greenguy's Board > Link Lists & Getting Listed
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2005-01-21, 01:41 AM   #18
Opti
I Didn't Do It
 
Opti's Avatar
 
Join Date: Aug 2003
Location: au
Posts: 795
Send a message via ICQ to Opti
here is some code that will determine the correct IP from any properly configured ISP proxy.

For anyone using a Submission script that logs webmaster IPs, using this code rather than simply relying on the REMOTE_ADDRESS variable to gather the IP will be a lot more effective.

PHP Code:
<?php
function getIP() {
   
$tmp = array();
   if  (isset(
$_SERVER['HTTP_X_FORWARDED_FOR']) && strpos($_SERVER['HTTP_X_FORWARDED_FOR'],',')) {
       
$tmp +=  explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);
   } elseif (isset(
$_SERVER['HTTP_X_FORWARDED_FOR'])) {
       
$tmp[] = $_SERVER['HTTP_X_FORWARDED_FOR'];
   }
   
$tmp[] = $_SERVER['REMOTE_ADDR'];
   return 
$tmp;
}
print_r(getIP());
?>
Check it what it outputs for your IP here:
http://xengio.com/XGOgetIP.php


(For LL owners that just glazed over thinking thats too technical for me.... it isnt as hard as it may look. If you can code html in notepad, you can likely incorporate that into almost any script all by yourself.)
Opti is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT -4. The time now is 12:37 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc