Closed Thread Icon

Preserved Topic: made up environment variables (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=12702" title="Pages that link to Preserved Topic: made up environment variables (Page 1 of 1)" rel="nofollow" >Preserved Topic: made up environment variables <span class="small">(Page 1 of 1)</span>\

 
quisja
Paranoid (IV) Inmate

From: everywhere
Insane since: Jun 2002

posted posted 04-26-2003 12:46

Is there a way to set some environment variables on my home computer so my script can tell whether or not they're running on my test machine at home or on the server. At home I'm using Win98SE, Apache 1.3, PHP 4.3. Thanks.


home

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 04-26-2003 16:03

I'm not 100% certain, but if you add a
set isTestmachine="shu" into your autoexec.bat (and rebootet),
you should be able to access that with isset($_ENV['isTestmachine']).
Otherwise, you could also write a function that compared the current IP to the one of your development machine...
like
function isTestMachine()
{
return ($_SERVER['HOST_IP'] == '192.213.334.something');
}

so long,

Tyberius Prime

« BackwardsOnwards »

Show Forum Drop Down Menu