Reply to Re: Relative path & php

Your name:

Reply:


Posted by Derick van Niekerk on 07/07/05 17:47

AF wrote:
> Help.
>
> Every time I use php my relative path gets messed up.
>
> For example take this code in an html file: (
> I have abbreviated it for illustration purposes)
>
> <img src="library_files/logo.gif" alt="Mortgage Loans" border="0"
> width="128" height="122"></a><br><br></td>
> <a href="index.html"><font size="1">Home</font></a></p>
>
> works great.
>
> I then put it into any php file and it doesn't.
>
> I have to change it to this in order to get it to work.
>
> <img src="http://www.domainname.com/library_files/logo.gif"
> alt="Mortgage Loans" border="0" width="128"
> height="122"></a><br><br></td>
> <a href="http://www.domainname.com/index.html"><font
> size="1">Home</font></a></p>
>
> Does anyone know why this is happening and how to fix the problem?
>
> When I say fix, I mean set the path programmatically so that I do not
> have to go manually edit every file and add http://www.domainname.com/
> to every href and src tag.
>
> Thanks for any help.

Try prefixing with './' - as in:

<img src="./library_files/logo.gif" alt="Mortgage Loans" border="0"
width="128" height="122"></a><br><br></td>
<a href="index.html">

[Back to original 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

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