/[LeafOK_CVS]/fenglin/lib/client_addr.inc.php
ViewVC logotype

Diff of /fenglin/lib/client_addr.inc.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 by sysadm, Thu Jun 10 11:27:10 2004 UTC Revision 1.10 by sysadm, Sun Mar 2 02:32:22 2025 UTC
# Line 1  Line 1 
1  <?  <?
2    require_once "common.inc.php";
3    
4  function Client_Address()  function Client_Address($addr=null,$x_addr=null)
5  {  {
6          if (isset($_SERVER["HTTP_X_CLIENT_ADDR"]))          if ($addr == null)
7                  return $_SERVER["HTTP_X_CLIENT_ADDR"];                  $addr = $_SERVER["REMOTE_ADDR"];
8          else  
9                  return $_SERVER["REMOTE_ADDR"];          if ($x_addr == null && isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
10                    $x_addr = $_SERVER["HTTP_X_FORWARDED_FOR"];
11    
12            return $_SERVER["REMOTE_ADDR"];
13  }  }
14    
15  ?>  ?>


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1