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">
Navigation:
[Reply to this message]
|