Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Practical Web Development
Practical Web Development

Practical Web Development: Learn CSS, JavaScript, PHP, and more with this vital guide to modern web development

eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

Practical Web Development

Chapter 1. The World Wide Web

This book talks about the past, present, and future of Web Development. Beginning with Chapter 2, HTML, we will walk you through all the technologies you need to know about, in order to practice web development. Before we do that, we want to set the stage, so that we all know which Web we are talking about: this would be the World Wide Web (www).

World Wide Web

I love history! So let us start with a little history about the World Wide Web. I was fortunate enough to be able to work at a company that developed the first commercial version of the UNIX Operating System. They were founded in 1977 and I joined them ten years later. UNIX is an Operating System (the thing you need to make your computer do something) that was intended to run on minicomputers (although they were called that, they could not fit into your apartment and required air-cooling). These computers were typically used as an isolated system that had quite a number of text-based terminals attached to them.

Today UNIX lives on, and forms the basis of Linux, Solaris, MacOS, and others. Our company spotted an opportunity to add products that would add features and technologies that today are standard. Some of these examples are email (ability to send a mail to a person on another computer), and ftp (ability to transfer a file to another computer, or to just access another computer). Yes, you had to pay extra if you wanted to be able to send mail. Thanks to the Internet, all of this was made possible.

The Internet

The Internet is a global network that today interconnects billions of computers worldwide. Its origin dates back to research done for the US government, but today everybody can get on the Internet, using its standard set of protocols, commonly referred to as TCP/IP (the IP here being Internet Protocol).

Every computer or device that is connected to the Internet will have a unique Internet address, aka IP address. It is a set of 4 numbers separated by dots, for example, 192.25.13.90. Of course, you will never tell your friend that you bought something at 192.25.13.90 but at, for instance, www.amazon.com. This is because the Internet also uses a feature that translates IP addresses into easier to remember domain names. The example I used happens to be a website you can go to and buy things from a practice that we all know has caused the www to become what it is today.

The Internet and the www are, in everyday speech, treated as if they are synonyms but they are indeed not. There are a lot of different services provided on the Internet (by companies called Internet Service Providers (ISP)), and that was already the case before the www existed (for example, giving you access to electronic mail). What it took for the www to emerge was (just like in JavaScript) a series of asynchronous events. Two of those are too important to not mention.

HTTP and HTML

You have probably heard this story many times, but the World Wide Web would not have existed without it. It is the story of Tim Berners Lee, an engineer at the European Centre for Nuclear Research (CERN). The centre had many computers that were, of course, hooked up to the Internet. It also produced a tremendous amount of data and documents, and that became almost impossible to manage. Tim worked out a solution by developing a language to write these documents in, a protocol on top of the Internet to manage them, as well as a computer program for users to access them.

HTML

HTML, short for Hypertext Markup Language is the name of that language. Hypertext is text that contains hyperlinks, which in turn are those parts of a document which readers can click on to take them to a different document, using the link. You have all seen the blue underlined parts of a text, in not-so-good-looking web pages. These are hyperlinks.

A document in HTML consists of tags, with text in between them. There are opening and closing tags for example, as follows:

<h1>Hello, world</h1>

Here, <h1> is the opening tag and </h1> the closing one. We will learn about a similar markup language: XML. HTML and XML are not the same though. One important difference is that in XML you can define your own tags, as long as you close each one you've opened. XML is used to transfer the data and the tags are used to organize the data.

In HTML, tags do have a specific meaning. <h1> would be used in a document for the text of a level one header. A <a> tag—the anchor tag—is the one used to include the hyperlinks we just discussed. So the purpose of writing HTML is not to transfer data, but to present it to human users.

To do so, these tags are interpreted by the computer program we mentioned earlier. Such a program is called a browser. When the reader clicks on a hyperlink, the browser will detect that as well, and send a request to yet another program, the web server, to go fetch another document.

HTTP

This is where HTTP, the Hypertext Transfer Protocol fits in. If a user clicks on a link, it is like saying: go fetch another HTML document. The name of that document would be part of a longer string that starts with http:// and also contains the domain name of the server. It is called a uniform resource locator, but we all refer to it as URL. Following is an example: http://www.paulpwellens.com/examples/secondpage.html.

What you can do with HTTP has evolved over time and we will learn about it later on in the book, but for now we need to move on with our history lesson. One more little tidbit of history for you: guess how our friend Tim called his browser, the first ever browser: WorldWideWeb. He later renamed it to avoid confusion.

The World Wide Web Consortium (W3C)

After he left the CERN in 1994, Tim Berners Lee founded the World Wide Web Consortium (W3C). The consortium tries to enforce compatibility and agreement between vendors that deliver components for the web. Incompatible versions of HTML would cause browsers to render web pages differently; and incompatible features added to browsers have the same unexpected result.

If you visit www.w3.org, the consortiums website, you will notice that the W3C has evolved into a standards body for many technologies, but even in those days, having such an organization was sorely needed.

Mosaic

History moved on, and so did I! Our company was acquired by Sun Microsystems and I became product manager for our PC UNIX product. Oh yes, before I forget, PCs were everywhere by then and that phenomenon would, in the long run, also contribute to the explosion of the World Wide Web.

One day, in the year 1993, my engineering manager walked into my office, together with Jonathan, his lead programmer. They wanted to show me what he (Jonathan) had done over the weekend. It was a port (take the source code of a program and make it run as a binary on a computer) of a program called Mosaic for our PC UNIX product. I saw him type a few commands but did not quite understand why these guys were so excited. Little did I know that this seemingly innocent little program was going to change our lives forever!

The first browser

Mosaic was developed at the National Center for Supercomputer Applications (NCSA)at the University of Illinois in Champaign-Urbana (this is a long drive through cornfields from Chicago, which I took once) by a team led by Marc Andreesen. It was the first browser to support multiple protocols (hence the name) as well as display an image and text on the same page (surprisingly, this is not a trivial matter on a webpage!) It soon caught attention worldwide and the browser was ported to many platforms, so that more and more people could develop or have access to websites.

In November 1992, there were 26 websites. In the Mosaic browser, there was a What's new section that showed a new website everyday. Three years later, there were 10,000 and another three years later, millions. Today, I do not think it is possible to count them anymore. So how did we get from thousands to millions?

Netscape

Marc Andreesen founded a company, named it after Mosaic, and then later renamed it Netscape Communications Corporation. They basically rewrote the Mosaic browser and optimized it for environments with lower network bandwidth, such as individuals who access the Internet from home through their ISP. The browser was called Netscape Navigator. This was clearly the first commercial browser, making it to the shelves of computer retail stores as part of a bundle, Netscape Communicator.

Netscape was also credited as the first browser to include support for JavaScript. With this scripting language, interactivity could be added to web pages. The World Wide Web could be at anybody's fingertips, as long as you had Netscape. From 1994 to about 1999, Netscape clearly had the biggest market share for browsers.

Over time, Netscape was moved over to Mozilla Corporation, an Open Source organization, and the development of Netscape ended. Today, users can download the Firefox browser from www.mozilla.org.

Internet Explorer

Another derivative of Mosaic, Spyglass Mosaic, made it into the Microsoft codebase and was eventually bundled with Microsoft Windows. We know it today as Internet Explorer. This is how we reach the topic of the so-called browser wars. As I mentioned, Netscape was trying to win over as many customers as possible by getting into the retail market and charge for its browser. Microsoft, on the other hand, decided to bundle Internet Explorer for free in its Windows Operating System (of course you had to pay for Windows).

This led to many lawsuit-like situations as Microsoft was accused of unfair competition by the other browser vendors. This situation has now changed as all browsers are free. Computer users can today choose which browser they want to use. On tablets, choices are limited, but on the other hand, browsers on tablets usually have all the latest features.

A different and potentially more bloody war was going on at the technical level. Despite having a standards body, the W3C, which controlled and introduced new features (both HTML and CSS), not all browsers were adapting those features equally as fast. So the same web pages continued to look different when they were rendered by different browsers. Sad but true to say, the browser that was the most incompatible and unpredictable, Internet Explorer, was, by the turn of the century, also the one used by the majority of the people who would surf the web.

Developers therefore had no choice but to delay the use of new cool features at the expense of spending a considerable amount of extra time making their web pages look the same on a PC used by most visitors as it did on the system where they were created.

Things got far worse before they began to get better, as more developers started using JavaScript to add interaction and animation to the pages, whereas many System Administrators recommended a configuration with JavaScript switched off. Sometimes this resulted in the visitor seeing nothing at all on the page.

But do not despair, we are in 2015 now! In this book, we will take a different approach and always let you use the new features when the browser supports it.

The explosion of the Web

By the turn of the century, every company wanted to have a webpage. Web pages were created by linking more web pages, with information about the company or just the owner of the site. The latter was made possible by smart ISPs that also offered web hosting. People have to be able to access your site even while you or your computer is sleeping; so these services offer 24/7 uptime to put your HTML files. Web hosting companies also take care of getting you a domain name, such as www.thecoolestphotographer.com.

At some point, obtaining the domain name you wanted was bordering on another browser war, as there could only be one xyz.com, and if some entrepreneurial folks thought that having xyz.com first would be worth money, they would grab it.

When I wanted one for myself, paulwellens.com was already taken by a British rugby player, so I went for www.paulpwellens.com (P is my middle initial). I am neither British nor a rugby player so this was fine with me.

So a lot of pages were created worldwide, but all they had initially was information for you to look at, nothing else. In some cases, they were created once and never updated. That fortunately was the exception to confirm the rule. Many companies decided that they had to have a presence on the web and corporate websites were thus created. The advent of CSS facilitated this a lot, as it allowed the separation of presentation and content. That way, the marketing department would provide the corporate logo, and the look and feel, and all the other departments would provide the content.

Amazon.com and e-commerce

Some creative minds realized that the Web presented an opportunity to do more than just provide information. It is only a (relatively) small step from providing the information of the products you have on your site, to actually selling them. E-commerce was thus born. Amazon comes to mind as a good example of a site that everybody can relate to as being a Web shop. Developing a web shop of course involved a lot more than having someone in the company type in some content.

These products are real products; they sit in a warehouse, have a part number, a price, a name and description, different sizes and colors, and so on. That information, more than likely, is already present in some database that is updated each time a product is sold in a retail store. To sell something online, your webpage has to interact with the visitor, present him with some kind of an on-screen shopping cart, calculate subtotals, check warehouse inventory, and so on.

To do this, more and more programming was involved, and not just data entry into an HTML file anymore. So the job of Web Developer was born. Traditional programmers are skilled in a single programming language (Java or C++) and usually a single platform (Solaris or .NET). Web Developers have to be fluent in at least four different languages, as well as know a thing or two about databases. I would like to add one aspect which, to me, makes this job very exciting—one gets to be involved in design aspects. The gap between a Web Designer and a Web Developer is narrowing. So today, one talks about Front-End and Back-End developers.

So this is what we will teach you in this book; how to be a Web Developer, but not before wrapping up our history lesson. There are a few more things that made the web what it is today.

Google and Yahoo!

So you have a website with information, or a web shop because you are selling something on the web, like www.mycoolproduct.com. How do you expect to reach your potential customers, call every single one of them? This is where Google or Yahoo fit in. These popular companies developed the so-called search engines. You want to find out everything there is to know about a movie you just watched, a song you cannot remember the name of, or simply the phone number of your favorite restaurant? You visit google.com, yahoo.com, or equivalent sites and type in what you are looking for. Chances are you will find it.

We did a usability study at work where we gave one group a set of CDs, a stack of manuals, and a computer to install; the other group did not get the manuals but Internet access. The second group did way better because they felt they did not need the manuals, as they assumed them to probably be out of date, and immediately looked things up online. And this happened over 10 years ago.

Today, the use of search engines is so commonplace that terms like Yahoo! and Google are used as verbs. In some languages, they actually have become verbs and made it into the official dictionary.

Social networking

I know people who do not use Facebook today, but I do not know anybody who does not know of Facebook. For years I walked by the building where Facebook had its office. I was not really interested. Then, when I moved back to Belgium, I decided to join them so I could stay in touch with my friends in California, who live in a different time zone and several thousands of miles away. From one of them I found out that the Facebook folks have since moved into the building where I used to have my office. Funny how that goes sometimes!

Facebook, Twitter, YouTube, and LinkedIn are examples of popular social networking sites. Nothing is sold here, but shared. People share pictures, stories, events, thoughts, ideas, opinions, and so on.

Web development

Many years ago, I took a 6 month class on what, basically, is part one of this book. Months into it, it became apparent that the lack of an introductory part that explains how all the components of the course were related, was the course's biggest flaw.

After six months, there were still people who did not understand the difference between Java and JavaScript. So I promised myself two things: that one day I would write a book, and that such a chapter would be part of it. So let's go!

HTML

Files written in HTML form the basis of every website. We briefly touched on its history in the previous section; here we will dig a little deeper in its structure. Look at the following example:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Hello World example<\title>
<\head>
<body>
  <h1>Hello, world<\h1>
<\body>
<\html>

The first line specifies DOCTYPE, referring to the HTML version used, so the browser knows how to interpret the file. The one in the example is indicative of HTML5. DOCTYPE statements used to be a lot longer.

This is followed by the main tag, the <html> tag. In-between, we will find all our HTML in two sections, <head> and <body>. The body tag is what contains your content, and the head tag contains other information. In our example, there is one metatag that specifies what encoding is used. The <title> tag contains text that will be displayed by the browser at the very top of the window. It is very important to not forget the <title> tag, as this is one of the things search engines will examine.

In this simple example, the body contains a single <h1> tag. This represents a level one header in the document, similar to headers you find in word processors. The browser will decide how to display that content or, as they say, render it. So how do we get the HTML into a file and how do we get it to a browser?

HTML editors and other tools

As an HTML file is just a text file, your favorite text editor will do just fine. Just make sure it has the .html extension in the name, for example hello.html.

However, at some point, you are probably going to include some CSS, JavaScript, and surely PHP in the same file, in which case specialized tools will make you far more productive.

Browsers and web servers

So now you have a file called hello.html and you want to look at it in a browser. In real life, this file will be part of your website and you will have to put it there. This is where the company that is hosting your website told you to put your files. They will give you all the information to correctly transfer your file(s) to their server.

They will end up in a folder that is called the document root, the root of all the files that make up your site. If you were to follow the instructions with the hello.html file and transfer it there, you will see the result when you type the following address in the URL bar of your browser:

http://www.mycoolsite.com/hello

You can also look at your file locally, and we will teach you more about that in the next chapter.

It is very important to realize that to the people who visit your site, your web page may not look the same as what you created. One factor—but not the only factor—is the browser that is being used. We therefor recommend that, from the early development stage on, you look at your work using different browsers and increase the number of browsers, for/and different devices.

Always install Mozilla Firefox and Google Chrome on your Mac or PC. Pick one to do your development (I like Firefox because of Firebug), but always do a little bit of testing with other browsers before you deliver.

So, start with our little example, and you will see that even Hello World will look different in different browsers. Fortunately, we can control almost all of this by using CSS.

CSS

Cascading Style Sheets (CSS) is a technology that works nicely in accordance with HTML and allows you, not the browser, to determine what your page will look like.

Look at this slightly modified example of our Hello, World webpage, hello.html:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Hello World example</title>
  <link href="hello.css"   rel="stylesheet" ></link>
</head>
<body>
  <h1 class="green header" id="hello">Hello, World </h1>
</body>
</html>

In the line containing the <h1> tag, we added two HTML attributes, class and id, to the <h1> element. Attributes are strings inside an HTML opening tag of the format name="value" and the two most important attributes you can use are class and id. Many elements can be part of several classes, but ids are unique to a single element.

Now create a file called hello.css with the following content:

h1 {
  font-family:Baskerville, cambria, serif;
  font-size:24px;
}
.green {
  color:green;
}
#hello {
  font-weight:bold;
  font-style: italic;
)

This is our first CSS stylesheet. The first rule in the file means that any <h1> element in our document will be in the Baskerville font (or cambria, if Baskerville is not present on the user's computer), at 24 pixels, and in the color the browser has chosen (usually black).

However, when it, or any other element, not just h1, has a class="green" (in CSS, the . in name means class name), it will be displayed in the color green.

Finally, our specific Hello World header will be displayed in bold and italics because of the last few lines in the CSS file. The # character is used in CSS to indicate an identifier, so the #hello rule means a rule for the element that is set to the id= "hello".

As a result of all of this, any browser should render our HTML file as a line containing the text Hello, world, displayed in letter type Baskerville (a serif font often used for eBooks, no relation to Sherlock Holmes that I know of), in green, of size 24 pixels, and in bold and italic. Just try it, it works!

Note that we did not repeat the Baskerville line in the #hello rule, the rule is simply inherited. The <h1> rules cascade into #hello, as this happens to be an <h1>, hence the name Cascading Style Sheets. As we just demonstrated, we can clearly separate the content and the presentation of our page by using CSS. That is why it is important to learn how to use CSS as early as possible.

So, as a Web Developer, you already know that you need to master at least HTML and CSS. We will now move on to the next piece of the language puzzle—JavaScript.

JavaScript

When we talk about JavaScript in this book, unless noted otherwise, we mean client-side JavaScript. All the code is interpreted, just like the HTML and CSS, by the browser.

By using JavaScript, we can add action to our pages and interaction with the visitors of our website, as well as change the contents and look of our page through programming. Let us take a look at the following example:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Hello World example</title>
  <link href="hello.css"   rel="stylesheet" ></link>
</head>
<body>
  <h1 class="green header" id="hello"></h1>
  <script type="text/javascript">

  var answer = confirm("Do you want to say hello?");
  if (answer == true)
  {

  document.getElementById("hello").innerHTML="Hello, world";
  }
  </script>
</body>
</html>

If you look at this page in a browser, there will be no Hello, World displayed on your screen, but a pop-up box will appear with a question. If you answer the question Yes, our familiar green Hello World text will be back. The pop-up box itself will look completely different when you use a different browser.

If you look at the code, you will recognize programming-like stuff. There is an if clause and there is a variable (answer). Note that the name of the variable is a normal character string but in its declaration it is preceded by var. All of the JavaScript code is in-between an HTML <script> tag with a type attribute of text/javascript.

There is one line that is very typical to JavaScript and does all the work for us:

document.getElementById("hello").innerHTML="Hello, world";

Chapter 4, JavaScript is where we will really teach you what this means. For now, we will give you the English interpretation of this line of code: In our document, replace the inner content of the HTML tag with id hello by the string Hello, world.

In subsequent chapters, we will introduce JavaScript libraries, which will allow you to write more compact JavaScript code, with a lot of work already done for you. jQuery is one of these libraries and will be discussed in Chapter 7, jQuery.

PHP

JavaScript is a complete language and allows you to do a lot more things than those we showed you in the previous little example. However, as I mentioned, this is client-side JavaScript, interpreted by the browser. So once you switch off your computer or tablet, it is all gone. Well, some of it may be saved on your machine.

Imagine trying to create an online store using only the languages we have mentioned so far. That would not work. The information of what is available in the store, as well as the data of your specific order has to live somewhere else. That would be the computer of the company that runs the store, not the device that runs the browser used to visit the site.

So, dear Web Developer, you have guessed it, you will have to learn at least one more programming language to deal with all of this, before you can create an online store. The language itself could be any of several (it can even be JavaScript), but where the code is stored and interpreted is the key difference here: a remote Application Server. One of the most popular of these languages is PHP, which is covered in detail in Chapter 5, PHP. Let us look at the following example:

 <?php
  $hello = "Hello World Example";
  $helloheader = '<h1 class="green" id="hello">Hello, World</ 
h1>';
 ?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title><?php echo $hello; ?></title>
  <link href="hello.css"  type="text/css" rel="stylesheet" ></link>
</head>
<body>
<?php
  echo $helloheader;
?>
</body>
</html>

So far we have been able to test our little examples in a browser, but this is different. To try out this example, you will need to have an Application Server, local or not, installed. For now, just read on.

Notice the <?php and ?> strings in the example. This is the beginning and end of where the PHP code resides and will have to be interpreted by that Application Server. The first portion of the code defines two variables. Note that in PHP, names of variables start with a $ sign, whereas in JavaScript they don't. echo, familiar to UNIX folks, simply echoes the value of these variables.

So once the AppServer is done interpreting the PHP code, all you are left with is our HTML example from the CSS section. This is exactly how it works: the AppServer interprets the PHP code, and then the WebServer passes the resulting HTML code to the browser.

Apache is the name of a very popular AppServer that happens to be a WebServer at the same time. This is software that runs on a computer we also call a server and this is where your program file resides: hello.php.

So http://www.mycoolsite.com/hello will be, once again, the way this webpage can be accessed. This may look like a little bit of using an overkill tour an additional language to display Hello, World. But there are some situations where you'd want to do so, for example if the data you need in your HTML is stored somewhere else.

Data

One of the main reasons to use the remote server and the server-side language is going to be the storage and manipulation of data. This data can be in several formats, from a flat text file to a spreadsheet, XML, JSON, or a full-fledged database, which requires a Database Server. In the latter case, you may need to learn yet another language, Standard Query Language (SQL) and deal with another (software) server: a database server. We will address several options in this book.

Summary

In this chapter we discussed the advent and history of the World Wide Web. Next we discussed Web Development in general with a few examples. In order to become a developer of Web Applications, you will have to master at least four languages: HTML, CSS, JavaScript, and a server-side language such as PHP.

Depending on how you plan to organize your data, there may be a need to learn a fifth language (SQL) as well. There will also be more things to learn, such as how to use a library or framework. The good news is that they all have their role in the overall picture of what a Web Application is all about.

Now that we know what we need to learn, let us go do it! We will start with HTML.

Left arrow icon Right arrow icon

Description

This book is perfect for beginners who want to get started and learn the web development basics, but also offers experienced developers a web development roadmap that will help them to extend their capabilities.

Who is this book for?

This book is perfect for beginners who want to get started and learn the web development basics, but also offers experienced developers a web development roadmap that will help them to extend their capabilities.

What you will learn

  • Find out how HTML lays the foundation of web development
  • Learn the fundamentals of web design using CSS
  • Harness JavaScript to bring websites to life
  • Use PHP and MySQL to dynamically generate HTML on the server
  • Learn how to write compact code with jQuery
  • Create efficient single page applications with Ajax
  • Discover JSON for a powerful data exchange between client and server
  • Design Mobile first, responsive pages that look great on mobiles, tablets, and desktops
  • Create and migrate powerful and scalable web applications with Node.js

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 30, 2015
Length: 276 pages
Edition : 1st
Language : English
ISBN-13 : 9781783552740
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want

Product Details

Publication date : Jul 30, 2015
Length: 276 pages
Edition : 1st
Language : English
ISBN-13 : 9781783552740
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 111.97
Practical UX Design
€32.99
Responsive Web Design with HTML5 and CSS3, Second Edition
€41.99
Practical Web Development
€36.99
Total 111.97 Stars icon

Table of Contents

16 Chapters
1. The World Wide Web Chevron down icon Chevron up icon
2. HTML Chevron down icon Chevron up icon
3. CSS Chevron down icon Chevron up icon
4. JavaScript Chevron down icon Chevron up icon
5. PHP Chevron down icon Chevron up icon
6. PHP and MySQL Chevron down icon Chevron up icon
7. jQuery Chevron down icon Chevron up icon
8. Ajax Chevron down icon Chevron up icon
9. The History API – Not Forgetting Where We Are Chevron down icon Chevron up icon
10. XML and JSON Chevron down icon Chevron up icon
11. MongoDB Chevron down icon Chevron up icon
12. Mobile First, Responsive Design with Progressive Enhancement Chevron down icon Chevron up icon
13. Foundation – A Responsive CSS/JavaScript Framework Chevron down icon Chevron up icon
14. Node.js Chevron down icon Chevron up icon
A. Bootstrap – An Alternative to Foundation Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.5
(6 Ratings)
5 star 16.7%
4 star 50%
3 star 16.7%
2 star 0%
1 star 16.7%
Filter icon Filter
Top Reviews

Filter reviews by




Michael Larsen Sep 11, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
At this point in time, programming for the web is a multi-faceted endeavor. There are so many choices and approaches that can be used, and technologies that can be called into action, that it is impossible to know them all. Gone are the days of basic HTML and some CGI scripts being all you’d need to deliver a web experience. Don’t get me wrong, there are still sites out there that are basically this simple, but they are not outnumbered by sites that offer much greater interaction, customization and the ability to display on multiple platforms. To do that effectively, more is needed.The challenge with most web development books (or programming books of any type, actually) is that it takes several hundred pages to cover everything needed, or the books are lean and abstract, with the reader having to do a lot of their own research and tinkering to make the examples work. "Practical Web Development" by Paul Wellins (Packt Publishing) takes a slice down the middle. It doesn’t pretend it will be able to show you everything in great detail, but it also looks to give some practical examples with the most common elements and some exercises to work and build on. Wellins progresses from basic HTML, CSS and JavaScript to using PHP, MySQL jQuery, AJAX, History API, XML & JSON, MongoDB, Responsive Design, Foundation framework and Node.JS. Make no mistake, that’s a lot of ground to cover in 276 pages.So how well does Paul traverse this formidable mountain range of topics?Part One of the book focuses on the central elements of a “stack” that allows a web site to exist in the first place, nd gives an over view of the technologies that work with that web server.Chapter 1 covers THE WORLD WIDE WEB, specifically where it’s been, where it is, and where it looks to be going. It’s a whirlwind history lesson that covers a lot of technologies that we take for granted today. For the purpose of the book, the emphasis is being placed on HTML, CSS, JavaScript and PHP, with a back end database using SQL. Therefore, up front, five “languages” need to be learned to be effective and use the book. Fortunately, the amount of each language that is needed to be learned will grow with each subsequent chapter, so you get a chance to use each of them as the book professes.Chapter 2 focuses on the basics of HTML and the most common tags used for markup of pages. Rather than give an exhaustive run down of all the tag elements, Paul gives us the ones that are the most useful and likely to be used when developing a basic site (headings, paragraphs, links, form elements tables and divs, which are best described as self contains rectangles of HTML). Paul also makes the distinction between the structure of a document (which is done with HTML) and the styling touches, which are handled in the next chapter.Chapter 3 covers what Paul feels are the most useful aspects of CSS, which is all about the syntax that affect the overall look and feel of your pages. The structure of the box model is central to CSS and being able to manipulate the data in a variety of boxes (often the aforementioned HTML div’s) helps to keep the style elements both contained and optimally configured. A recommendation for the use of Firebug or Development Tools in your respective browser is also recommended, as there are a lot of possibilities within CSS and ways to apply them.Chapter 4 takes us on a tour of JAVASCRIPT with a dose of Programming 101, and builds on some of the basic building blocks of of all programming languages while focusing on the core elements that make JavaScript useful in web pages and applications, specifically as a client side programming language. Variables and variable declarations are covered, manipulation of strings and numbers, operators, control flow, functions, and objects all get a brief but focused examination. The final part of the chapter talks about using the Document Object Model (DOM) and ways to work with objects, properties methods and events. Again, it’s a high level view, but one in which you feel like you can relate to what’s being presented.Chapter 5 introduces PHP, which is a language designed specifically for server side interactions. Again, like the previous chapters, this section focuses on what most users would need to make something work on the server using PHP, not a complete rundown of the syntax. This chapter also goes through the basics of what you need to do to check if your web host is set up to support PHP and what to do if it isn’t.Chapter 6 adds more about PHP, specifically in conjunction to working with a MYSQL database. The chapter starts with a basic understanding of databases in general ,and then MySQL in particular. It introduces the way that databases work and how MySQL fits into the web stack. phpMyadmin is covered as well, which allows you to administer a SQL database via the php utility. It also walks the user through several commonly used database commands and fundamental queries.Part II of Practical Web Development aims to help us break away from the model of multiple pages where a few will suffice, and to get away from static pages to those that are more interactive, dynamic and responsive to the platform it is being displayed on.Chapter 7 covers JQUERY, which is a JavaScript library that emphasizes a small footprint. It uses CSS selector style syntax that specify DOM elements. Again, the coverage is not exhaustive, but it give enough to show the general approach to using jQuery as part of your page development and the most likely to be used aspects of the library.Chapter 8 focuses on AJAX (Asynchronous JavaScript and XML) which is really a handful of different techniques that allow for data to be retrieved in small pieces without requiring the entire web page be reloaded. jQuery has several methods that allow for AJAX to be used. $.load and $post both allow for portions of the screen to be replaced with fresh HTML, dynamically generated or programmatically placed.Chapter 9 covers THE HISTORY API, which becomes very important when you start creating a site that is based primarily around a single page. rather than direct a user to the previous site they were on before coming to ours, the History API allows the users to navigate back to states of the page, or to allow for a bookmark URL to represent the state of the page bookmarked.Chapter 10 focuses on using XML (extensible Markup Language) and JSON (JavaScript Object Notation) as data formats to be used as an alternative to HTML.XML files can be seen as small databases. XML Schema defines the structure XML files, while XSLT creates stylesheets for converting XML into different formats. SimpleXML allows for paged to be created and processed using PHP. JSON is a lean format that gets processed like JavaScript objects in the browser, and therefore requires much less overhead.Chapter 11 introduces us to MONGODB, which is a type of NoSQL (not relational) database. It’s more readily known as a document database, and it stores JSON objects that are grouped into collections. Web applications are capable of communicating with the MongoDB using PHP..Part Three of the book moves away from the underpinnings of the technology and deals with methods that help the loo and feel of the users experience, regardless of the platform being used.Chapter 12 focuses on MOBILE FIRST, RESPONSIVE DESIGN WITH PROGRESSIVE ENHANCEMENT (go ahead, say that ten times fast ;) ). The key idea is that, based on the platform it is being displayed, the page will dynamically tailor itself to display optimally for that device. Desktops, tablets and phones have radically different screens and needs, and Responsive Design aims to help with that. One of the key aspects of this chapter is to encourage you to focus on mobile development and display first, and then work back. Additionally, another JavaScript library called EnhanceJS allows for different experiences to be displayed depending on the browser being used or the platform accessing the content.Chapter 13 introduces FOUNDATION – A RESPONSIVE CSS/JAVASCRIPT FRAMEWORK. The idea behind Foundation is that it lets us focus on developing a site without having to reinvent the wheel on the responsive part. By using a grid system, you can determine how many areas can be used depending on the size of the screen, so that the site expands and reformats based on the grid. Foundation also includes a number of UI enhancements that make it easier to put together navigation, image display and other details that make interacting with a site easier based on the available real estate.Chapter 14 closes out the book with an introduction to NODE.JS, which is, at its core a fundamental break with all of the rest of the web development options discussed in the previous chapters. Rather than require a whole host of technologies, everything can be written within Node, which then translates everything to native JavaScript (and by extension HTML, CSS, etc.). This can be done using the Express framework, which is described in basic detail, and the idea of templating (which is what PHP does), using handlebars.js.An Appendix section describes BOOTSTRAP - AN ALTERNATIVE TO FOUNDATION. The same exercises Paul described in Chapter 13 he tackles here, but uses Bootstrap.JS. It meets a similar goal, i.e. making a mobile-first, responsive site without having to reinvent the wheel to provide the responsive part.Bottom Line:The title of the book is Practical Web Development, and a special emphasis needs to be placed on the “Practical” part of the title. Paul has strived to make a book that is accessible, easy to follow, and lean enough to be usable without getting the reader lost in the weeds. I’ve long been looking for a book that would be a soup to nuts title, one that could be the starting point for someone to start with developing for the web, and have a single source to get up and running. Is this that book? It’s pretty darn close! There’s lots of additional areas that could have been covered, but to his credit, Paul has made a title that hits the high points, and a few divergences that are interesting if not mandatory. For a lean and straightforward primer on Modern Web Development approaches, this is a great place to start.
Amazon Verified review Amazon
Amazon Customer Aug 19, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
There are may books in the market focusing on specialized areas of Web Development. However, I was looking for a single book to give an overview of the different technologies in Web Development area and I came across this book. This book does a great job in quickly introducing various web development technologies such as HTML, CSS, JavaScript, PHP, jQuery, Ajax, MongoDB, Responsive Design, and Node.js. For in-depth understanding you may have to refer to another books focusing on specialized areas such as Node.js or NoSQL development. Overall I found this a handy book for quick overview on Web Development.
Amazon Verified review Amazon
Carles Aug 16, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The book is a good way to introduce all the necessary concepts of web development to beginners, covering areas from basic http mechanics to advanced actual technologies like responsive design or node.js. My only concern about the book regards the very low deepness treating all this concepts. As I said before it's a good book to novice web developers writing their first web app or changing te focus from desktop apps to web or cloud oriented ones. For me, as a trained web developer the book doesn't fit my needs, besides being useful as a quick reference manual. So my advice is to check your skills on this matter before buying this book, otherwise you can find really good books from this same publisher that may fit your needs better.
Amazon Verified review Amazon
Fine Reader Aug 16, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Good introductory primer on web programming topics. HTML, CSS, JavaScript, PHP are covered, as well as jquery, ajax, and SQL. Also includes a brief introduction to core programming concepts ("Programming 101"). Would recommend this book for someone who is interested in learning web development but does not have a programing background. It gives a solid framework on which to build further skills and the vocabulary to bridge the gap between beginner and intermediate levels.
Amazon Verified review Amazon
Andrew Valdez Sep 23, 2015
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Paul Wellens got it right.....and wrong...I will say that this book is 'Practical', in that the information in it covers a range of web development technologies but not in the manner of which you assume by looking/reading the title. Like many, I made the assumption that the book teaches you how to develop websites with the bare essentials, making it "Practical". However, you don't actually build anything...what you really do instead is read up on the various programming languages. Unfortunately, you just don't actually do anything with them. I didn't read the entire book but I did get up to chapter 9...After skimming through the rest I realized this isn't necessarily what I needed. This is more of a refresher guide in my honest opinion. Thankfully, I didn't purchase the book...I was able to read it through my Safari Online account. Either way, if your new to programming all together and want to get into web development, this is definitely not the way to go. If you have programming knowledge and experience, this is still not the way to go. I would suggest this for anyone already associated with common web programming languages (html, php, css, javascript, MySQL, jQuery etc...)
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.