PDA

View Full Version : newbie question - don't know how to describe it.


cb911
Nov 3, 2003, 07:13 PM
first of all, sorry for the lack of a descriptive thread title, i just did not know the correct terminology to use.

all i want to do it host a picture on my site, and do stuff like link to it from MR.

so lets say my address is www.address.com. then how do i have a picture so you can type www.address.com/picture and have just the picture open in a browser window? do i just put the picture on the server in the same directory as index.html?

and how would i have a sub-section of a site? like address.com/stuff that would open another index.html file? is that a sub-domain? sorry i don't really know any of the proper terminology...

thanks for your help. i hope i explained that properly. :)

edit> has something changed with the way the forums work. now you can just type a URL with 'www' infront and it will automatically link. this is new isn't it? very handy, won't have to hit the 'http://' button as much now. :p

rainman::|:|
Nov 3, 2003, 07:27 PM
whatever is in the same directory as index.html can be accessed by removing the "index.html" and adding the filename. think of it as pathnames in OS X. if you created a directory alongside index.html, called "pics", and put "sample1.jpg" inside, it would have the following URL:

http://yoursite.com/pics/sample1.jpg

you can add directories as you wish. You can also use relative pathnames, if you wanted to link to sample1.jpg from index.html (to display it on that page), just use pics/sample1.jpg, you need to start the pathname either referring to a file or a directory that contains that file. this is only for direct HTML linking tho.

most people prefer to keep images out of the root directory (where index.html is) for simplicty... or just the images used by index.html. but it's very handy to keep all images in one spot, makes it much easier to reference from multiple pages.

okay those last two paragraphs had nothing to do with what you asked, but hey :)

pnw

cb911
Nov 3, 2003, 08:09 PM
thanks paulwhannel, that makes sense.

so if i put a new folder (lets say i call it "extras") in the root directory of the server, i will be able to put pictures in there, then type the URL mysite.com/extras/picure.jpg to view that picture?

i just want to check that this is the right way to do things. i really don't want to mess anything up. :p

tazo
Nov 3, 2003, 08:10 PM
Originally posted by cb911

so if i put a new folder (lets say i call it "extras") in the root directory of the server, i will be able to put pictures in there, then type the URL mysite.com/extras/picure.jpg to view that picture?

Precisely :)

Also, dont be afraid to ask a basic question! Even the experts started out small :)

cb911
Nov 3, 2003, 09:13 PM
thank you 'weird avatar guy photo' tazo. :D :p

i know i'll have more questions as well, but i thought i'd just ask about the basics here. i'll probably end up going to a Flash forum, or Dreamweaver forum to ask some more difficult stuff. not that there aren't people here who could help me...

tazo
Nov 4, 2003, 12:14 AM
Originally posted by cb911
thank you 'weird avatar guy photo' tazo. :D :p

No problem ;) If its a basic question I might be able to answer it :)

whocares
Nov 4, 2003, 12:37 AM
Originally posted by cb911
so if i put a new folder (lets say i call it "extras") in the root directory of the server, i will be able to put pictures in there, then type the URL mysite.com/extras/picure.jpg to view that picture?

To continue on paulwhannel's thaughts, the absolute and relative addresses for the pisc would respectivley be:

mywebsite.com/extras/pictures.jpg

./extras/pictures.jpg

This would for say, if you wanted to display the pictures in your index page (mywebsite.com/index.html). This works just like path names in the terminal (if you're familiar with this):
*to move down to a subsequent directory, just use the slash and directory name "./directory_name/file.ext". The dot in front of the first slash is to say that you're starting from the current directory. If you don't put the dot ("/directory_name/file.ext") it will start at the root directory.
*to move up one directory, preceed the directory with a double dot (../directory_name/file.ext). This will go up one directory level and look the the directory "directory_name" from there. To go back two directories, just add two extras dots (../../directory_name/file.ext)
*it may be easier just starting from the root directory (/dir1/dir2/file.ext).

Hope this is clear and is helpfull.

PS Do I get a gift for cramming the word directory in there fifteen times :rolleyes: