You are here: Re: OT. Windows server paths and PHP includes « HTML « IT news, forums, messages
Re: OT. Windows server paths and PHP includes

Posted by BootNic on 06/18/07 05:48

> dorayme <doraymeRidThis@optusnet.com.au> wrote:
> news: doraymeRidThis-F4139C.15150418062007@news-vip.optusnet.com.au
> In article <9sodi.928$iz5.806@newsread4.news.pas.earthlink.net>,
> "BootNic" <bootnic@bounce.earthlink.net> wrote:
[snip]
> I got "Failed to open directory."

It's the error I wrote, but should have been Failed to change.

Try the following, don't hold out for anything to happen.

<?php
echo getcwd();
?>

If that does work, you may try to put it in your includes folder and get
the path to your folder.

Else you could try this ugly messy, it may be better then changing it
on each and every page.

<?php
$file="myincludes/h.txt";
if(file_exists($file)){
include($file);
}
else {
$j=0;
$dir="../";
$path="";
while(!$path && file_exists($dir) && $j<100){
if(file_exists($file)){$path=$file;}
else{$file=$dir.$file;}
$j++;
}
include($path);
}
?>

--
BootNic Monday, June 18, 2007 1:47 AM

Man who scratch ass should not bite fingernails.
*Ancient Chinese Proverbs*

 

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

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