Lars Plessmann wrote:[color=blue]
> Pedro Graca wrote:
>[color=green]
>> Lars Plessmann wrote:
>>[color=darkred]
>>>Well, I tried now to specify absolute paths like
>>>"http://127.0.0.1:8080/projectname/common_inc.php"
>>>But it cannot be included then. Thats the browser string of the file.
>>>Why doesn't it work?[/color]
>>
>>
>> Use filesystem paths:
>>
>> require_once 'C:/htdocs/common_inc.php';
>> require_once 'C:/htdocs/classes/fileB.php';
>>
>>[/color]
>
> problem: I develop on windows and my host is unix.
> how to handle this?[/color]
Maybe like this (PHP 5)?
<?php
if (stripos(PHP_OS, "win") === false) {
require_once '/htdocs/common_inc.php';
} else {
require_once 'C:/htdocs/common_inc.php';
}
?>
stripos() is available from PHP 5
PHP_OS is a core predefined constant
http://www.php.net/manual/en/reserve...tants.core.php
if you don't have PHP 5 try:
<?php
function my_stripos($haystack, $needle, $offset=0) {
return strpos(strtoupper($haystack), strtoupper($needle), $offset);
}
?>
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :