A Complete Guide to Web Design

(やまだぃちぅ) #1
144 Chapter 8 – Creating Links

Non-Web Links and Protocols


Web Design in a Nutshell, eMatter Edition

mailto:username@domain?bcc=person2
mailto:username@domain?body=body
Additional variables are appended to the string with a& as follows:
mailto:username@domain?subject=subject&cc=person1&body=body
Spaces within subject lines need to be written as%20(the space character in hexa-
decimal notation). The following is a sample mail link employing these additions:
<A HREF="mailto:[email protected]?subject=Like%20your%20book">
Email for Jen</A>

FTP Link (ftp://)


You can link directly to a file on an FTP server. When the user clicks on the link,
the file will automatically download using the browser’s built-in FTP functions and
will be saved on the user’s machine. If the document is on an anonymous FTP
server (i.e., no account name and password are required), the FTP link is simple:
<A HREF="ftp://server/pathname">...</A>
If you are providing a link to an FTP server that requires the user to log in, the
format is:
<A HREF="ftp://user:password@server/pathname">...</A>
It is highly recommended that you never include both the user name and pass-
word to a server within an HTML document. If you use the syntaxuser@server/
path, the user will be prompted to enter his or her password in a dialog box.
By default, the requested file is transferred in binary format. To specify that the
document should be transferred as an ASCII file, add;type=ato the end of the
URL:
<A HREF="ftp://user:password@server/pathname;type=a">...</A>
The variabletype=didentifies the pathname as a directory and simply displays its
contents in the browser window.
Following are some examples of FTP links:
<A HREF="ftp://[email protected]/program.exe">...</A>
<A HREF="ftp://ftp.superwarehouse.com/games;type=d">...</A>

Other Links


The following URL types are not as well known or as useful asmailto:or
ftp://, but they are available. As with other links, place these URLs after the
HREF attribute within the anchor tag.

Type Syntax Use
File file://server/path Specifies a file without indicating the protocol.
This is useful for accessing files on a contained
site such as a CD-ROM or kiosk application,
but is less appropriate over networks (such as
the Internet).
Free download pdf