Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Kinds of URLs 115

6


Although your browser uses FTP to fetch the file, if it’s an HTML file, your browser will
display it just as it would if it were fetched using HTTP. Web browsers don’t care how
they get files. As long as they can recognize the file as HTML, either because the server
explicitly says that the file is HTML or by the file’s extension, browsers will parse and
display that file as an HTML file. If they don’t recognize it as an HTML file, no big deal.
Browsers can either display the file if they know what kind of file it is or just save the
file to disk.


Non-Anonymous FTP


All the FTP URLs in the preceding section are used for anonymous FTP servers. You
also can specify an FTP URL for named accounts on an FTP server, like the following:


ftp://username:[email protected]/home/foo/homepage.html


In this form of the URL, the username part is your login ID on the server, and pass-
word is that account’s password. Note that no attempt is made to hide the password in
the URL. Be very careful that no one is watching you when you’re using URLs of this
form—and don’t put them into links that someone else can find!


Furthermore, the URLs that you request might be cached or logged somewhere, either on
your local machine or on a proxy server between you and the site you’re connecting to.
For that reason, it’s probably wise to avoid using this type of non-anonymous FTP URL
altogether. You may find yourself using non-anonymous FTP to upload your HTML files
(or other files related to websites) to a web server in order to publish them. Normally, it’s
best to connect to the FTP server using a dedicated FTP client rather than the browser.
Using FTP to publish web content will be covered in Lesson 23, “How to Publish Your
Site.”


Mailto


Mailto URLs are used to send electronic mail. If the browser supports mailto URLs,
when a link that contains one is selected, the browser will open a new outgoing email
in your default email application and send that message to the address in the link when
you’re done. Depending on how the user’s browser and email client are configured,
mailto links might not work at all for them.


The mailto URL is different from the standard URL form. It looks like the following:


mailto:internet_email_address


Here’s an example:


mailto:[email protected]

Free download pdf