Reply to Re: Better way of swapping between localhost and server?

Your name:

Reply:


Posted by Dikkie Dik on 09/12/06 19:32

I don't like global variables much, but I make an exception for
settings. Just create a settings.php file that contains all
server-dependent settings as assignments to global variables and include
that file from the pages that needs them. You can put the settings file
outside the webroot, so it will be hard to get for a normal web user.

Best regards

elyob wrote:
> 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/";
> }
>
> Zend studio didn't like 'REMOTE_ADDR' - Undefined index: REMOTE_ADDR,
> which then meant it couldn't include any files and fell over.
>
> I am also having problems using cookies and sessions ..
>
> if ($_SERVER['REMOTE_ADDR']=="127.0.0.1") {
> session_set_cookie_params(7200);
> } else {
> session_set_cookie_params(7200, '/', '.example.com');
> }
>
> This works fine on server, but not locally.
>
> Any suggestions on whether I am doing the right method?
>
> Thanks
>
>
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация