|
Posted by dorayme on 06/18/07 06:20
In article
<M0pdi.5438$tb6.782@newsread3.news.pas.earthlink.net>,
"BootNic" <bootnic@bounce.earthlink.net> wrote:
> > 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);
> }
> ?>
Well, you are starting to knock me over as in 'with a feather'. I
got a result! I got a path from your code that looked (I have *
some content just for here) like this:
e:\****\****\includes
I then stuck it in my php include code strip:
<? include "e:\*****\*****\includes\footer.inc"; ?>
and lo and behold, the footer appeared exactly as with a
"regular" path like <? include "../includes/footer.inc"; ?>
Now, that was trialled from within a test folder called
"includes" on the server. The big test: will it work if I have
this on a file deep in other directories?
Lemme see...
Well... well... it does work! You did it Bootnic. I am very
impressed.
Last time I named a js script after you (remember, about
centering blocks of floating thumbnails?), it sits on a server
showing off my daughters recent wedding. But what can I do here?
Perhaps a comment in the source code to the effect that viewers
are able to see footers, banners, navigation blocks because of
some crafty probing by Bootnic. (Wonder what the company execs
will think of that if they ever come across it? It is a
commercial site <g>)
Seriously, thanks mate.
--
dorayme
Navigation:
[Reply to this message]
|