Jump to content

Remote Addr Local Testing


Lockit

Recommended Posts

sorry, than i'm not sure about what you mean, because the solution i gave does not need any changes in code

 

esp. if you define the variable $TEST using an include statement..

 

include 'test.inc.php';

$ip=$_SERVER['REMOTE_ADDR']

if ($TEST)  {
    $ip="another ip-address";
}

 

and in this 'test.inc.php':

<?php
$TEST=True;
?>

 

after testing you only need to change the 'test.inc.php' file.....

Hmm, I never was good with explanations.

I am not 100% sure something like this would work but what I am attempting falls along the lines of:

if($_SERVER['REMOTE_ADDR'] == "192.168.2.1") {
  $ip = (Some method to retrieve the real IP.);
} else {
  $ip = $_SERVER['REMOTE_ADDR'];
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.