PDA

View Full Version : I'm going CRAZY!!! Please help me out!


subduck
08-25-2002, 10:36 PM
Okay lets say I have a menu that I am including in many pages using... include ("menu.php")

now lets say I have these files

include tutorials index.php images
| | |
menu.php bla.php dog.gif


Now I need to include "menu.php" into "index.php" and "bla.php".

So let's say my include file (menu.php) had an image in it "dog.gif"
The current url for dog.gif is images/dog.gif
now this if fine for index.php, but it won't work for bla.php because bla.php is in a subdirectory

Here is the problem. What is the code I use in order to view "dog.gif" from "index.php" and "bla.php"??

The only solution I can think of is having the url be this:
www.myurl.com/images/dog.gif

That way no matter what file uses it they will always be able to see that image.

Isn't there another way to do this so I don't have to write the entire url?

I thought about this....
<img src="<? echo $DOCUMENT_ROOT; ?>/images/bottom_menu/s_box_up.gif">

but that doesn't work :(

please help me!

firepages
08-27-2002, 05:27 AM
<img src="<? echo $DOCUMENT_ROOT; ?>/images/bottom_menu/s_box_up.gif">

should work fine, but also try

<img src="<? echo $HTTP_SERVER_VARS['DOCUMENT_ROOT']; ?>/images/bottom_menu/s_box_up.gif">