|
Posted by Dan Gelder on 09/29/56 12:01
On Jan 26, 4:28 pm, Kailash Nadh <kailash.n...@gmail.com> wrote:
> On Jan 26, 8:25 pm, Dan Gelder <daniel.w.gel...@gmail.com> wrote:
>
>
>
>
>
> > Never mind the last question, I got it. Now I have another problem:
>
> > When i include a php script in another php file, I'd like to put some
> > img tags inline along with it. The images are in the same file as the
> > script I'm including. If I get __FILE__ inside my script (which is the
> > only way I can find to get the actual script file) then how can I
> > munge the result to turn
>
> > /home/.machine/user/site.com/work/january/phpstuff/includer.php
>
> > into just
>
> > /work/january/phpstuff/
>
> > So I can end up with
>
> > <img src="http://site.com/work/january/phpstuff/img.jpg"> in the
> > echo'd result?
>
> > I know I can hardcode it but I'd rather not, I'd rather just have it
> > work.
>
> > Thanks
> > Dan
>
> $dir = dirname(__FILE__);
>
> --
> Kailash Nadh |http://kailashnadh.name- Hide quoted text -
>
> - Show quoted text -
Thanks for that guess but no, that just turns
/home/.machine/user/site.com/work/january/phpstuff/includer.php
into
/home/.machine/user/site.com/work/january/phpstuff/
and you can read my post to understand why that brings me no closer
than before.
What I need to know, I guess, is a way to get the official root folder
so I have
/home/.machine/user/site.com/
And then I can match the strings?? Can't say how to solve it yet.
[Back to original message]
|