Creating Data-Driven Web Sites
eBook - ePub

Creating Data-Driven Web Sites

An Introduction to HTML, CSS, PHP, and MySQL

Bob Terrell

Condividi libro
  1. 138 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Creating Data-Driven Web Sites

An Introduction to HTML, CSS, PHP, and MySQL

Bob Terrell

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

The purpose of this book is to provide an introduction to this set of technologies to teach a new programmer how to get started creating data-driven websites and to provide a jumping-off point for the reader to expand his or her skills.

Today's modern world is heavily dependent on the World Wide Web. It affects the way we communicate, how we shop, and how we learn about the world. Every website, every page, consists of four fundamental elements: the structure, the style, the programming, and the data. These correspond to four different "languages, " respectively: HTML, CSS, PHP, and MySQL.

After learning the necessary components, users will have the understanding required to use the above technologies to create a working website. This book is aimed at the programmer or student who understands the basic building blocks of programming such as statements and control structures but lacks knowledge of the syntax and application of the above-mentioned technologies.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Creating Data-Driven Web Sites è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Creating Data-Driven Web Sites di Bob Terrell in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Web Programming. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2019
ISBN
9781946646057
CHAPTER 1
image
HTML
HTML is not, strictly, a programming language. HTML stands for hypertext markup language. It is a way of marking text, so that a web browser knows how to display it. It can be considered the most basic “building block” of a web page, and as such, it is where we begin.
It is customary when teaching a new language to begin with a simple program that simply outputs Hello, world! With HTML, it couldn’t be simpler. Open a new document in your editor and type in “Hello, world!”, as seen below (Figure 1.1).
image
Figure 1.1. Desc: “Hello, world!” in a text editor window
Save the file to your web root with the name hi.html (Figure 1.2).
image
Figure 1.2. Desc: file “hi.html” visible in a folder
View the results in your web browser of choice. Enter in the URL for your web root, and add hi.html to the end (Figure 1.3).
image
Figure 1.3. Desc: “Hello, world!” displayed in a web browser
You’re done!
FUNDAMENTALS
So what’s really going on here? The short answer is it is the browser’s job to make as much sense of an HTML file as it can. We can see what it has done by inspecting the web page. In Chrome: View -> Developer -> Developer Tools. In the window or pane that opens, select the Elements tab. We see that the browser has taken our file, which the web server has told it is an HTML file (thanks to the.html extension) and added to it. We should see something like the following (Figure 1.4):
image
Figure 1.4. Developer Tools window in Chrome
The document is located on the left. We see our Hello, world! text on the left. What’s the rest of that?
An HTML file is rendered by the browser into a document with elements. Note the three elements in document: the <html> element, which encompasses the entire document; the <head> element, which is currently empty and provides information about the document; and the <body> element, which contains the part of the document that the web browser is intended to render. Because our file contained only plain text, the browser created enough elements for our document to make sense. It put the contents of our file into the <body> element.
Revisit the document in the text editor and add in some of the elements the browser filled in on its own. Change the document to be as such:
image
Save the file and refresh the browser window. It should look pretty much the same! Only this time, the browser is reading our file and parsing (making sense of) it.
TAGS AND ELEMENTS
An html file is made up of markup contained in tags. An HTML tag consists of an open angle bracket (less than sign), certain characters to denote the type of tag, and a closing angle bracket (greater than sign). Tags may not have a space between the opening angle bracket and the letters. In the file above, note that we have three tags: <html>, <head>, and <body>. These correspond to the html, head, and body elements that the browser renders in its document.
HTML tags usually come in sets. There is an opening tag, as described above, and there is a closing tag, telling the browser when the element in question should end. A closing tag is an angle bracket, followed by a slash, followed by the same characters used in the opening tag. In the file above, every opening tag has a corresponding closing tag. A more correct description of our file would be that there are three opening tags: <html>, <head>, and <body>; and three closing tags: </head>, </body>, and </html>.
Also note that HTML is hierarchical: Elements can contain other elements when tags of another element are found in between the opening and closing tags. The head and body elements are contained within the html element because the <head> and <body> tags appear between the opening <html> and closing </html> tags.
While it’s possible to not close tags—if our file above was missing the closing tags, the browser would still render it correctly—some tags must be closed, and the browser will always try to render a document as if it were well-formed. It’s also possible to close tags not in reverse order: For example, the following would most likely render correctly:
image
but it is not well-formed. The following is well-formed:
image
Note the differences. The </u> closing tag closes the <u> element, which was the last one opened, followed by </b> to end the <b> opening tag. We also properly closed the <p> tag with the closing </p> tag. Don’t worry if you aren’t familiar with what these tags do! They’ll be explained soon enough. For now, simply note what it means to have well-formed HTML: that tags are closed in reverse order that they are opened.
BEST PRACTICE
Although web browsers give their best effort to make sense of an HTML file, throughout this book we will endeavor to generate well-formed documents. A...

Indice dei contenuti