Visa ett inlägg
Oläst 2013-03-07, 14:35 #5
seoonline seoonline är inte uppkopplad
Nykomling
 
Reg.datum: Sep 2012
Inlägg: 12
seoonline seoonline är inte uppkopplad
Nykomling
 
Reg.datum: Sep 2012
Inlägg: 12
Resolved!

PHP-kod:
    /**
     * Returns the clients IP address.
     *
     * @return string
     */
    
public function getClientIP() {
        
//Proxy handling.
        
$tmp_ip $_SERVER['REMOTE_ADDR'];
        
$x_fwd = isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : null;
        if(
self::$x_forwarded_for && $x_fwd !== null) {
            
//Cut out the first IP address
            
if(($cpos strpos($x_fwd',')) !== false) {
                
$tmp_ip substr($x_fwd0$cpos);
                
$x_fwd substr($x_fwd$cpos+2);
            }
            else { 
//Only one IP address
                
$tmp_ip $x_fwd;
                
$x_fwd null;
            }
        }
        
$this->x_fwd $x_fwd;

        return 
$_SERVER['HTTP_X_REAL_IP'];
    } 
seoonline är inte uppkopplad   Svara med citatSvara med citat