PDA

View Full Version : Just a little Question...



Christopher
March 23rd, 2002, 18:16
I am not new to HTML and all, but I have never actually learnt how to do this...

Lets say you have a page in a directory, lets say
yoursite/info/page.html

And you want to get a picture from
yoursite/images/pic.gif

How do you do that? Do you need the basehref tag?

I would do that, but my all of my pages are in a top-middle-bottom type format, I include the top with php include() then put in my middle, then inlcude the bottom.

I don't know how to link the includes if I am in another directory, do I just put in all of the address (ex. http://yourname.com/includes/top.php) or is there another way?

I don't know if I made this clear or not, if I didn't please ask! I need help!

Christopher
March 24th, 2002, 08:39
Why doesn't anyone help? :cry2:

meow
March 24th, 2002, 09:09
I don't understand...where does php come in? If you are saying you want to know how to write the path to that image in an image tag try:

<img src="../images/pic.gif" width="" height="">

"../" gets you one directory up from where the html doc is "images/" gets you down in the images folder.

Is that what you're asking? :confused:

Christopher
March 24th, 2002, 09:37
So, what if I wanted to go up like 3 directoies? ../../../?

meow
March 24th, 2002, 09:51
You've got it baby! :D

You could also write the path from the web root (hopefully your main folder) if the server is set up that way. If "yourname" is your root then it would be like so, with just a beginning slash:

/images/pic.gif

The first way is safer if you play around on free hosts and move a lot because not all allow the root thing.

Christopher
March 24th, 2002, 09:52
Yay! Thanx meow! :D


Im off to make a new design now, :biggrin2:

Christopher
March 24th, 2002, 09:53
Originally posted by meow
The first way is safer if you play around on free hosts and move a lot because not all allow the root thing.

Im hosted at emunetwork.. Wonder if they have it... :confused2

meow
March 24th, 2002, 10:03
I meant safer because if you move you may have to rewrite all paths.
The ../yadda/ always works and works locally on your machine too - the root thing does not..

Christopher
March 24th, 2002, 10:11
Ahhhh, I see.