External, mail and file links

We see three types of links. Those directed to other pages of other websites, to email addresses and external files.

Throughout the previous articles we have seen internal links, within the same page, and local links, which occur when pages within the same website are referenced. They were very common types of links, but there are still other types that we must review to complete the information.

In this article we will address the last 3 types of links that we had indicated. They do not have much to do with each other, but since they are simple, we group them all in this text. They are links to external pages (other domains), links to email addresses and links to download files.

remote links

They are the links that go to pages that are outside our website, that is, any other document that is not part of our site. Generally, our website will be on a specific domain, such as example.com. Remote links are those that go to pages that would be in a different domain.

This type of links is very common and does not represent any difficulty. We simply put in the HREF attribute of our To tag the URL or address of the page we want to link to. It will be something similar to this.

go to guiarte.com

It should only be noted that all web addresses (URLs) begin with http://, or https:// in the event that the destination page is served through a secure server. These types of paths that start with “http” are also known as “absolute paths”. When you link to pages that are on other domains you necessarily need to use absolute paths.

Note: The part with which the website addresses begin (http://) tells us that the protocol through which it is accessed is HTTP, the one used on the web. We must not forget to place them, because if we do not, the links will be treated as local links to our site.

See also  What is Copyleft?

Another interesting thing is that we don’t necessarily have to link to a web page with the HTTP protocol. We can also access resources through other protocols such as FTP. In such a case, the addresses of the resources will not start with http:// but with ftp://.

Links to email addresses

The links to email addresses are those that when clicked open a new email message addressed to a specific email address. These links are very common on web pages and are the fastest way to offer the visitor a way to contact the owner of the page.

To place a link directed to an email address, we place mailto: in the href attribute of the link, followed by the email address to which the link should be directed.

eugim@

This link can be seen in action here:

Advice: When you place links to email addresses, try to indicate in the content of the link (what is between A and its closing) the email address to which it should be written. This is because if a user does not have a mail program configured on his computer, he will not be able to send messages, but at least he will be able to copy the mail address and write the mail through another computer or a web-mail system.

In addition to the recipient’s email address, we can also place the subject of the message in the link. This is achieved by placing a question mark, the word subject, an equal sign (=) and the specific subject after the email address.

eugim@

See also  Dates in PHP

We can place other attributes of the message with a similar syntax. In this case, we also indicate that the email must go with a copy to colabora@.

miguel@ Note: The visitor to the page will need to have an account configured email in your system to send the messages. Logically, if you do not have a mail service on your computer, you will not be able to send messages and this system of contact with the visitor will not work.

Later on we will address the issue of , through which we will be able to implement a series of fields to request information of all kinds, which can then be sent by email. It is a more usable way in terms of contact with the user. Outside of this manual we also have an article on web development that analyzes the alternatives that exist for .

File Links

This is not a type of link itself, but we point it out here because it is a very common type of link and presents some complications for the novice user.

The mechanism is the same that we have known in local links and remote links, with the only peculiarity that instead of being directed towards a web page, it is directed towards a file of another type.

If we want to link to a file my_file.zip that is in the same directory as the page, we would write a link like this.

Download my_file.zip

If we click on a link of this type, our browser will download the file, asking the typical question of “What do we want to do with the file. Open it or save it to disk”.

See also  The NodeJS execution process

Tip: Do not put executable files directly on the Internet, but rather compressed files. For two reasons:

  1. The file will occupy less, so its transfer will be faster.
  2. By asking the user what they want to do with the file, it offers them the option of opening it and saving it to disk. We generally want the user to save it to disk and not run it until they have it on their hard drive. If you decide to open it instead of saving it, it will simply start it up and when you stop it, it will not be saved on your system. If the files are compressed, we will force the user to decompress them on their hard drive before starting them, thus making sure that the user saves it on their computer before running it.

If we want to link to another type of file such as a PDF or a VRML world (Virtual Reality for the Internet) we continue to do it in the same way. The browser, if it recognizes the file type, is responsible for opening it using the appropriate connector for it. Thus, if, for example, we link to a PDF, it will put the Acrobat Reader program into operation to display the contents. If we link to a VRML world, it will launch the plug-in that the user has installed to view the virtual worlds.

This would be an example of a link to a PDF document.

Download the PDF

Loading Facebook Comments ...
Loading Disqus Comments ...