Schweitzer Fachinformationen
Wenn es um professionelles Wissen geht, ist Schweitzer Fachinformationen wegweisend. Kunden aus Recht und Beratung sowie Unternehmen, öffentliche Verwaltungen und Bibliotheken erhalten komplette Lösungen zum Beschaffen, Verwalten und Nutzen von digitalen und gedruckten Medien.
Learn the essentials of creating web apps with some of the most popular programming languages
PHP, MySQL, & JavaScript All-in-One For Dummies bundles the essentials of coding in some of the most in-demand web development languages. You'll learn to create your own data-driven web applications and interactive web content. The three powerful languages covered in this book form the backbone of top online apps like Wikipedia and Etsy. Paired with the basics of HTML and CSS-also covered in this All-in-One Dummies guide-you can make dynamic websites with a variety of elements. This book makes it easy to get started. You'll also find coverage of advanced skills, as well as resources you'll appreciate when you're ready to level up.
This All-in-One is a great value for new programmers looking to pick up web development skills, as well as those with more experience who want to expand to building web apps.
Richard Blum is a highly experienced programmer and systems administrator. He is also author of the most recent editions of Linux For Dummies and Linux All-in-One For Dummies.
Introduction 1
Book 1: Getting Started with Web Programming 5
Chapter 1: Examining the Pieces of Web Programming 7
Chapter 2: Using a Web Server 29
Book 2: HTML5 and CSS3 57
Chapter 1: The Basics of HTML5 59
Chapter 2: The Basics of CSS3 89
Chapter 3: HTML5 Forms 121
Chapter 4: Advanced CSS3 143
Chapter 5: HTML5 and Multimedia 163
Book 3: JavaScript 183
Chapter 1: Introducing JavaScript 185
Chapter 2: Advanced JavaScript Coding 213
Chapter 3: Using jQuery 233
Chapter 4: Reacting to Events with JavaScript and jQuery 253
Chapter 5: Troubleshooting JavaScript Programs 273
Book 4: PHP 291
Chapter 1: Understanding PHP Basics 293
Chapter 2: PHP Flow Control 315
Chapter 3: PHP Libraries 339
Chapter 4: Considering PHP Security 365
Chapter 5: Object-Oriented PHP Programming 385
Chapter 6: Sessions and Carts 411
Book 5: MySQL 435
Chapter 1: Introducing MySQL 437
Chapter 2: Administering MySQL 457
Chapter 3: Designing and Building a Database. 483
Chapter 4: Using the Database 507
Chapter 5: Communicating with the Database from PHP Scripts 537
Book 6: Creating Object-Oriented Programs 557
Chapter 1: Designing an Object-Oriented Application 559
Chapter 2: Implementing an Object-Oriented Application 589
Chapter 3: Using AJAX 615
Chapter 4: Extending WordPress 647
Book 7: Using PHP Frameworks 673
Chapter 1: The MVC Method 675
Chapter 2: Selecting a Framework 689
Chapter 3: Creating an Application Using Frameworks 707
Index 729
Chapter 1
IN THIS CHAPTER
Understanding how simple web pages work
Incorporating programming into your web page
Storing content in a database
At first, diving into web programming can be somewhat overwhelming. You need to know all kinds of things in order to build a web application that not only looks enticing but also works correctly. The trick to learning web programming is to pull the individual pieces apart and tackle them one at a time.
This chapter gets you started on your web design journey by examining the different pieces involved in creating a simple web page. Then it kicks things up a notch and walks you through dynamic web pages. And finally, the chapter ends by explaining how to store your content for use on the web.
Before you can run a marathon, you need to learn how to walk. Likewise, before you can create a fancy website, you need to know the basics of how web pages work.
Nowadays, sharing documents on the Internet is easy, but it wasn't always that way. Back in the early days of the Internet, documents were often created using proprietary word-processing packages and had to be downloaded using the cumbersome File Transfer Protocol (FTP). To retrieve a document, you had to know exactly what server contained the document, you had to know where it was stored on the server, and you had to be able to log into the server. After all that, you still needed to have the correct word-processing software on your computer to view the document. As you can imagine, it wasn't long before a new way of sharing content was required.
To get to where we are today, several different technologies had to be developed:
This section describes the technology that made viewing documents on the Internet work the way it does today.
In 1989, Tim Berners-Lee developed a method of interconnecting documents to make sharing research information on the Internet easier. His creation, the World Wide Web, defined a method for linking documents together in a web structure, so that a researcher could follow the path between related documents, no matter where they were located in the world. Clicking text in one document took you to another document automatically, without your having to manually find and download the related document.
The method Berners-Lee developed for linking documents is called hypertext. Hypertext embeds links that are hidden from view in the document and directs the software being used to view the document (known as the web browser) to retrieve the referenced document. With hypertext, you just click the link, and the software (the web browser) does all the work of finding and retrieving the related document for you.
Because the document-viewing software does all the hard work, a new type of software had to be developed that was more than just a document viewer. That's where web browsers came into existence. Web browsers display a document on a computer screen and respond to the reader clicking hypertext links to retrieve other specified documents.
To implement hypertext in documents, Berners-Lee had to utilize a text-based document-formatting system. Fortunately for him, a lot of work had already been done on that.
Markup languages were developed to replace proprietary word-processing packages with a standard way of formatting documents so that they could be read by any type of document viewer on any type of device. This goal is accomplished by embedding tags in the text. Each tag indicates a formatting feature, such as headings, bold or italic text, or special margins. What made markup languages different from word-processing packages is that these tags were common text codes instead of proprietary codes, making it generic enough that any device could read and process them.
The first popular markup language was the Generalized Markup Language (GML), developed by IBM in the 1960s. The International Organization for Standardization (ISO) took up the challenge of creating markup languages and produced the Standard Generalized Markup Language (SGML), mainly based on GML, in the 1980s. However, because SGML was developed to cover all types of document formatting on all types of devices, it's extremely complex and it wasn't readily adapted.
Berners-Lee used the ideas developed in SGML to create a simplified markup language that could support his hypertext idea. He called it Hypertext Markup Language (HTML). HTML uses the same concept of tags that SGML uses, but it defines fewer of them, making it easier to implement in software.
An example of an HTML tag is <h1>. You use this tag to define text that's used as a page heading. Just surround the text with an opening <h1> tag, and a corresponding closing </h1> tag, like this:
<h1>
</h1>
<h1>This is my heading</h1>
When the browser gets to the <h1> tag, it knows to format the text embedded in the opening and closing tags using a different style of formatting, such as a larger font or a bold typeface.
To define a hypertext link to another document, you use the <a> tag:
<a>
<a href="anotherdoc.html">Click here for more info</a>
When the reader clicks the Click here for more info text, the browser automatically tries to retrieve the document specified in the <a> tag. That document can be on the same server or on another server anywhere on the Internet.
HTML development has seen quite a few changes since Berners-Lee created it and turned it over to the World Wide Web Consortium (W3C) to maintain. After many years of faithfully maintaining the HTML standard, unfortunately, it had met with some controversy, as a competing standard, maintained by the Web Hypertext Application Technology Working Group (WHATWG), a consortium of several vendors, emerged. Table 1-1 shows the path the HTML standard has taken.
TABLE 1-1 HTML Versions
Version
Description
HTML 1.0
Formally released in 1989 as the first public version of HTML
HTML 2.0
Released in 1995 to add interactive elements
HTML 3.0
Released in 1996 but never widely adopted
HTML 3.2
Released in 1997, adding support for tables
HTML 4.01
Released in 1999, widely adopted, and remains an often-used standard
XHTML 1.0
Released in 2001, standardizing HTML around the XML document format
XHTML 1.1
Released in 2002, making updates and corrections to XHTML 1.1
HTML 5.0
Released in 2014, adding multimedia features
HTML 5.1
Released in mid-2017, adding form validation and context menus
HTML 5.2
Released in late-2017, adding additional styling features
HTML 5.3
Also released in late-2017, this was the final version released by the W3C
In 2019, the W3C stopped as the sole maintainer of the official HTML standard and joined with the WHATWG consortium to produce a single HTML standard, called the HTML Living Standard. This is now considered the official HTML standard, and the standard that this book focuses on. The Living Standard doesn't have specific release versions, but instead, incorporates changes "on the fly" to the HTML specifications once they are approved by their board. You can find the latest HTML features described at the WHATWG website, html.spec.whatwg.org/multipage/. The WHATWG documentation refers to the term HTML5 as a buzzword, often used to describe the modern HTML standard.
html.spec.whatwg.org/multipage/
Besides a document-formatting standard, Berners-Lee also developed a method of easily retrieving the HTML documents in a client-server environment. A web server software package runs in the background on a server, listening for connection requests from web clients (the browser). The browser sends requests to retrieve HTML documents from the server. The request can be sent anonymously (without using a login username), or the browser can send a username and password or certificate to identify the requestor.
These requests and responses are defined in the Hypertext Transfer Protocol (HTTP) standard. HTTP...
Dateiformat: ePUBKopierschutz: Adobe-DRM (Digital Rights Management)
Systemvoraussetzungen:
Das Dateiformat ePUB ist sehr gut für Romane und Sachbücher geeignet – also für „fließenden” Text ohne komplexes Layout. Bei E-Readern oder Smartphones passt sich der Zeilen- und Seitenumbruch automatisch den kleinen Displays an. Mit Adobe-DRM wird hier ein „harter” Kopierschutz verwendet. Wenn die notwendigen Voraussetzungen nicht vorliegen, können Sie das E-Book leider nicht öffnen. Daher müssen Sie bereits vor dem Download Ihre Lese-Hardware vorbereiten.Bitte beachten Sie: Wir empfehlen Ihnen unbedingt nach Installation der Lese-Software diese mit Ihrer persönlichen Adobe-ID zu autorisieren!
Weitere Informationen finden Sie in unserer E-Book Hilfe.