This first "lesson" can be somewhat cumbersome, but consider it very important to know how to tell what elements are involved in web communication and then to distinguish, when programming a website, where you have to locate the various elements, applets etc. we need.
Usually when we visit a website, follow these steps:
• write the web address in your browser (eg www.google.es) and press the Enter key to load.
• On the screen, after a few seconds, the web want.
What really happens to us in writing that direction is shown a page?
• When you press Enter, your browser issues a request to the server hosting the page you want to visit saying, basically, "Give me the content of this direction."
• The server receives the request and returns the page in HTML (HyperText Markup Language, Hypertext Markup Language), which is the basic code that a browser understands and defines the look of the page to display.
• The client browser (your Firefox, your Internet Explorer ...) is that code, it interprets and displays on your screen.
Simple, right? This helps us to be reeling a bit more and see that all web communication involves two "agents" so to call: the client (your internet browser or, generalizing, you) and server (containing the web you want to visit). We will not get into how the browser knows what web server should be consulted for access according to what page it is not the purpose of this blog, but if anyone is interested I can tell you what is the procedure followed.
A simile "simple" to understand the philosophy that continues to this process is to either store. The client (you) comes looking a product that claims that the dependent (which would be the server). It looks for the goods that can give you and you give it. You, on your part, you examine it and give you deem appropriate use. Let
further complicate the example to better illustrate the process going. Suppose now that we visit a website with an Internet browser, such as the google page. The process to display the home page we have seen, but what happens when executing a search?
• After pressing the Search button (or press Enter) your browser you are sending a form via the Internet to a specific Internet address, which is already determined by the page you are visiting (eg google index contains a form that determines that, clicking search, you must send the form to another page dedicated to google search results.)
• The server receives the request for displaying a page with a set of parameters (determined by the form filling). Note that we are not having a page for each search can be made (that would be insane) but there is a page that:
• i. Get the search parameters you specified.
• ii. Performs custom search.
• iii. Genera a set of results.
• Now if recapitulate remember that the client browser only understands HTML and therefore, the server must return a page in that format. What to do with that dynamic set of results just obtained? The solution obviously is to generate both HTML and needed to return a browser page that the client can understand. Simplifying the issue, we might think we return a line of text for each result has been obtained, so the server page, once all the results obtained, "insert" as many lines as the results obtained and this result final will be returned to your browser.
Here's what a server-side language. Schematically, it would be:
How to distinguish a website that can generate dynamic results such as the example given of one who does not? The solution is to see the extent that the web has to call. For example, if we open the page http://www.google.es/index.html see that we call the "index" page that has the extension "html" inside the server www.google.es . On the contrary, if we open a page whose name is, for example (This address is invented, but it illustrates what we have said): http://www.miweb.com/buscar.php?termino=programar
we can see that we are opening the page "search" extension "php "within the server www.miweb.com and also a parameter we have passed under the name" term "and the value" program. "
extensions web pages are different depending on the content to be displayed (static, dynamic) and the type of server-side language to be used. Categorizing, these are some examples of extensions:
• Static content (the web always gives the same look and content every time we visited): extensions HTML, HTM ...
• Dynamic Content (the web is adapted to a number of parameters and both the appearance and content vary according to these parameters): PHP, PHP3, ASP, JSP, ...
There are many more extensions that we find as we sail and see different pages, not to mention a web browser can play different file types (videos, photos, pdf, office files, etc) and each has its extension. But faced with the programming of dynamic pages, the most noteworthy are listed (PHP, ASP (based on Microsoft technologies) and JSP (Java-based technologies)).
With this I believe it is clear which is a server-side language and what is its function. Although the diagram above is not reflected, usually the processing of information is accompanied by a query to a database. For those who do not know, a database can be understood as an organized and structured repository of information, such data can be registered users of your website, the comments received on it, the categorization of words for a search engine, etc. . Subsequent chapters will work with MySQL databases as they are the easiest found on free hosting sites.
Now back to the example of going to a shop. Suppose we buy a brand new DVD of what we know a number of features that should have. We came, we tell the salesperson what we seek and it offers several. We chose one and the seller delivers it to us with his instructions. We got the DVD, we got home, plugged it and find instructions for playing movies, change the language, format etc etc etc screen.
adapt the example to a web communication.
• Enter in the search box to find what we want, for example, an online calculator (equivalent to tell the seller the characteristics of our DVD).
• The server offers the results for our search (we reduce the catalog DVD models that conform to what is sought).
• Access to a page that contains a calculator that allows us to do arithmetic without having to be referring to other sites, everything is done the same page.
Graphically, if we take the diagram shown above:
(7) arithmetic with a calculator
(8) Net operating
If we look, we see that added in the client (your browser) a speech processor that is dedicated client to carry out operations in your browser, without having to carry out communications with an external server. That is, your web browser is capable of conducting operations and process data.
The question that arises is: when I schedule a web page, in what cases you have to use a client language and circumstances in which a server language? But the answer is simple:
• If you perform operations involving data refer only you possess, which are inherent to your website (eg your product catalog), you should use a server-side language, since the data consult your computer are not of the person who then refer your site, but on the server where you host your site and, by extension, your data.
• If the operations to perform are of the "display an alert if the ordering has not indicated how much to ask," activate the unit number field when you select the product ", etc etc, in that case is recommended to use the client language since they are operations that can be made on the page that the customer is viewing.
Eye, note that in the case of transactions with client language, only recommend its use, since virtually all operations of client language can be made through sending data to the server, but is more comfortable for the person who visits your page that does not have too much communication (remember that each time you visit a page, you have to wait while the request is sent from your browser, the server answers and your browser processes the result) and perform simple operations such as validity checks on a form can be done without sending the form to the server generally.
For example, this table can provide you with understanding some of the most common operations are usually done on one side or other communication (in some cases it is imperative that either the server side or client):
LANGUAGE CUSTOMER | LANGUAGE SERVER |
• Check that a field has a number (without letters), or that is in capital letters, etc (value checks a field in general). • Issue a warning message. • shipping confirmation request to the server. • Activate a field to the value to take another field. • Make a button "lights up" when you mouse over it. • Display help messages. | • Serve a set (or subset if you do a search) of data on the topic of your site (eg forum messages, products of an area, etc etc). • Save and / or manipulate information to send a user (interaction with database). • Perform checks on data received in the parameters. • Tell the client to a different page depending on what conditions. |
There are many more operations can be performed, but above I think you can already have an accurate overview of where it is appropriate to perform some other operations. The most widely used language usually client Javascript (JS extension) but there are other options such as VisualBasic Script (normally used in conjunction with ASP pages to be both technologies Microsoft).
for today I think is right. In the next post will start working with PHP, to recommend some tools which are necessary or desirable to have installed on your computer and get to see the first PHP (which will be extremely easy but we will move). Greetings
0 comments:
Post a Comment