Posted by Peter Fox on 09/12/06 16:10
Following on from elyob's message. . .
>Hi,
>I am currently developing on a windows XP machine and upload my code via
>subversion to a linux server. All was great, until I just tried to test out
>using Zend Studio.
>
>if ($_SERVER['REMOTE_ADDR']=="127.0.0.1") {
> $base_path="../path/";
>}
>else {
> $base_path="/home/account/public_html/path/";
>}
Base your switch on where the host is (ie what you're _really_ trying to
switch on) not on who's calling.
eg (but many alternatives) $_ENV['COMPUTERNAME']
or
$_SERVER['SERVER_NAME']
Server name will be localhost when running locally.
--
PETER FOX Not the same since the e-commerce business came to a .
peterfox@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
[Back to original message]
|