|
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
>
>
>
Navigation:
[Reply to this message]
|