You are here: Better way of swapping between localhost and server? « PHP Programming Language « IT news, forums, messages
Better way of swapping between localhost and server?

Posted by elyob on 09/12/06 15:23

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]


Удаленная работа для программистов  •  Как заработать на 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

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