PHP experts...HELP. My Menu header is pointing to the wrong

Grinch

Joined: 2002-08-28
Posts: 24
Posted: Fri, 2002-08-30 03:01

First of all, thanks to those that have provided answers to my previous issues. I've cleared all of them up. But I've got one more.

I have a Main Menu header that I use throughout my website. But I'm having a tiny bit of trouble getting it to work with Gallery. In a nutshell, my graphics in the Menu are missing. Here's a bit of the code I have in the gallery.header file:

<? includeHtmlWrap("wrapper.header"); ?>

<script language="javaScript" type="text/javascript" SRC="../includes/js/dd.js"></SCRIPT>
<link rel="stylesheet" href="../includes/css/global.css" type="text/css">

<? include ("../mymenuheader.php"); ?>

So the CSS and JS are loading fine. But when I include the my menu, it tries to load the images from http://www.mysite.com/gallery/images instead of http://www.mysite.com/images. What I need is a way to trick include of "mymenuheader" into thinking it's at the root so that the graphics will load. Is there a way for me to do this? I'm trying to avoid making duplicate copies of the Menu and moving my directories around. I want to have only one Menu page to worry about for the entire site.

The only work around I have is by forcing the images to load from the root by using <img src="www.mysite.com/images/pic.gif">. I would rather not do it that way because it makes designing from my local network messy.

I've also been checking out PHP.NET and it seems that this issue is not uncommon. People have offered ways to correct the problem, but I can't make heads or tails of it.

Any advise would be great.

 
zjs2k

Joined: 2002-08-24
Posts: 33
Posted: Fri, 2002-08-30 05:40

Well, maybe I am not smart enough to find out a better way except using the root directory. But I guess you can always set your html editor so that it can find file from a web root directory. I am using DreamWeaver. In DW, you can set a local directory as your webroot. Then set all link use root directory when you choose your image files. If you are using DW, you should be able to figure that out.

 
Grinch

Joined: 2002-08-28
Posts: 24
Posted: Fri, 2002-08-30 05:51

As a matter of fact, I am using Dream Weaver. It doesn't make a difference because my site is undergoing a complete redesign. 99% of it is only available on my local drive at this time.

 
Grinch

Joined: 2002-08-28
Posts: 24
Posted: Fri, 2002-08-30 19:35

I finally figured it out. It was so stupid in the end.

images/mypic.gif = bad
/images/mypic.gif = good

My bad.

 
zjs2k

Joined: 2002-08-24
Posts: 33
Posted: Fri, 2002-08-30 20:33

When you choose a image in DW, in the popup window, look at the left bottom corner. Select the "Relative To" to "site root". Then dreamweaver will add the first slash for you.