You are here: Re: listing root directory « PHP Programming Language « IT news, forums, messages
Re: listing root directory

Posted by Kailash Nadh on 09/29/31 12:01

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

 

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

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