(Ebook) Web Application Design and Implementation: Apache 2, PHP5, MySQL, JavaScript, and Linux UNIX (Quantitative Software Engineering Series) by Steven A. Gabarró ISBN 9780471773917, 0471773913instant download
(Ebook) Web Application Design and Implementation: Apache 2, PHP5, MySQL, JavaScript, and Linux UNIX (Quantitative Software Engineering Series) by Steven A. Gabarró ISBN 9780471773917, 0471773913instant download
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-peterson-
s-sat-ii-success-1722018
(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT
Subject Test: Math Levels 1 & 2) by Arco ISBN 9780768923049,
0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-arco-
master-the-sat-subject-test-math-levels-1-2-2326094
(Ebook) Cambridge IGCSE and O Level History Workbook 2C - Depth
Study: the United States, 1919-41 2nd Edition by Benjamin
Harrison ISBN 9781398375147, 9781398375048, 1398375144,
1398375047
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044
https://ebooknice.com/product/professional-lamp-linux-apache-mysql-and-php-
web-development-2001692
https://ebooknice.com/product/the-apache-modules-book-application-
development-with-apache-prentice-hall-open-source-software-development-
series-978224
https://ebooknice.com/product/javascript-for-modern-web-development-
building-a-web-application-using-html-css-and-javascript-49177184
https://ebooknice.com/product/setting-up-lamp-getting-linux-apache-mysql-
and-php-working-together-2022622
Web Application Design
and Implementation
•• e T ..
~I t 807 ~
=1~WlLEY:
:12007 ;
-;
• '
. l e . . . T ..... I ...
.
r
<S achgeneration has its unique needsand aspirations. When Charles Wiley first
opened his small printing shop in lower Manhattan in 1807, it was a generation
of boundless potential searching for an identity. And we were there, helping to
define a new American literary tradition. Over half a century later, in the midst
of the Second Industrial Revolution, it was a generationfocusedon building the
future. Once again, we werethere,supplyingthe criticalscientific,technical,and
engineering knowledge that helped frame the' world. Throughout the 20th
Century, and into the :new millennium, nations began to reach out beyond their
own borders and a new international community was born. Wiley was there,
expanding its operationsaround the world to enable a global exchangeof ideas,
opinions, and know-how.
For 200 years, Wiley has been an integral part of each generation's journey,
enablingthe flowof information and understanding necessaryto meet their needs
and fulfill their aspirations. Today, bold new technologies are changing the way
we live and learn. Wiley will be there, providing you the must-have knowledge
you need to imaginenew worlds, new possibilities, and new opportunities.
Generations come and go, but you can always count on Wiley to provide you the
knowledge you need,when and whereyou need it!
Lu~';'~~.~ ~~u~
WILLIAM .... PESCE PETER BaaTH WILEY
PRESIDENT AND CHIEF' EXECUTIVE DFFlCER CHAIRMAN OF" THE BOARD
Web Application Design
and Implementation
Apache 2, PHP5, MySQL,
JavaScript, and Linux/UNIX
Steven A. Gabarro
Stevens Institute of Technology
Hoboken, New Jersey
IEEE
~computer
SOciety
60TH anniversary
"'
BICENTENNIAL
it807~
.
=~WILEY=z
.-
z
:2007~
,.~
BICENTENNIAL
WILEY-INTERSCIENCE
A John Wiley & Sons, Inc., Publication
Copyright © 2007 by John Wiley & Sons, Inc. All rights reserved.
Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their
best efforts in preparing this book, they make no representations or warranties with respect
to the accuracy or completeness of the contents of this book and specifically disclaim any
implied warranties of merchantability or fitness for a particular purpose. No warranty may be
created or extended by sales representatives or written sales materials. The advice and
strategies contained herein may not be suitable for your situation. You should consult with a
professional where appropriate. Neither the publisher nor author shall be liable for any loss
of profit or any other commercial damages, including but not limited to special, incidental,
consequential, or other damages.
For general information on our other products and services or for technical support, please
contact our Customer Care Department within the United States at (800) 762-2974, outside
the United States at (317) 572·-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears
in print may not be available in electronic formats. For more information about Wiley
products, visit our web site at www.wiley.com.
Preface xiii
About the Author / xiii
Before We Get Started I xiii
Who Should Read This Book? I xiv
About the Examples I xiv
How to Read This Book I xiv
Acknowledgments xv
1. Fundamentals 5
The Origins of the Internet I 5
The World Wide Web I 6
The Web Browsers I 7
The Web Servers I 7
TCP/IP BASICS I 8
The Internet Layer I 9
The Transport Layer I 11
The Application Layer I 11
The Toolbox I 12
Browsers I 12
FTP I 13
Email Clients I 14
Programming Tools I 14
Other Useful Tools I 15
3. Introduction to HTML 27
What Do You Need to Get Started? I 27
How Does HTML Work? I 28
Syntax Basics / 28
File Structure I 28
Tag Parameters I 30
Basic Text Formatting I 30
External References I 32
Links I 32
Images I 33
CONTENTS vii
Organizing Data / 34
Lists / 35
Tables / 36
Frames / 39
Special Characters I 43
4. Work Environment 45
Introduction I 45
Downloading the Software I 45
Installing the Apache Server I 46
Installation Steps I 46
Checking the Installation I 47
Possible Errors I 47
Configuring Apache I 48
Installing PHP5 I 48
Testing PHP I 50
Installing MySQL I 50
Adding a MySQL User I 51
How Do I Know if MySQL is Running? I 51
Installing PhpMyAdmin I 51
Installing a Bulletin Board: phpBB I 52
Installation Steps I 52
Basic Security Considerations I 54
Conclusion I 55
Multidimensional Arrays / 71
Array Functions / 74
PHP Program Structure and Flow of Control / 77
Conditions / 77
Loops / 80
Functions / 82
Bibliography 269
Index 271
Preface
Steven Gabarr6 was born in 1979 and raised in Alicante, Spain. He started
programming early, learning BASIC (Beginner's All-purpose Symbolic
Instruction Code) at age 9. Later on, in high school, he learned Turbo Pascal
and C. At that point it was pretty obvious that he was going to end up as a
computer scientist. He ended up studying for a master's degree in computer
science in the Ecole Pour l'Informatique et les Techniques Avancees, where
he specialized in advanced multimedia and Web technologies, graduating
with honors, finishing third in his class. He went to the United States in
January 2002, enrolling in the Masters of Science in Information Systems at
the Stevens Institute of Technology, in Hoboken, New Jersey. There he quickly
advanced from teaching assistant to full-time instructor. On his appointment
as full-time faculty, he created the first Web programming course at Stevens,
based on his personal experiences. This book is the result of that course, and
is a close reflection of what Steven teaches his students.
The way this book is organized, it should be ideal for anyone trying to learn
how to create complete Websites with no previous knowledge of any of the
languages presented. It does require some minimum knowledge of program-
ming in general, as well as object-oriented programming basics to understand
Chapter 8.
It is also a good read for Web designers that know about making pages
look nice, but have no knowledge of how to create dynamic pages built
through a database or anyone who would like to pick up on the art of pro-
gramming pages. Realize: that I have never been a good graphic designer, so
this book will not tell you how to do things like making decisions regarding
the proper colors, fonts, or sizes to use, or other cosmetic details. I will deal
with how to set those features up, but will not tell you how to pick your layout
or color schemes, because I am definitely not good at it. Instead, I will con-
centrate on how to actually program useful pages with loads of functionality.
All the examples have been tested, and if any are not compatible with a spe-
cific browser, this will be stated in the text. You can find all the example files,
as well as an example solution for the mini exercises and the indexer/searcher
case study at ftp://ftp.wiley.com/public/sci_tech_med/web_application. I will
also work on extra examples that I will make available to illustrate other areas
of the book that did not get a full example. I would have included many more
examples, but then you would need two or three volumes this size. Instead, I
will just put everything in a Website for you to download and test. I hope you
enjoy it all!
The book is organized to be read front to back, but you may skip chapters as you
see fit, or use the book as a reference. The Introduction is a summary of Chapter
19 and should be used by people already experienced in Web development. It is
basically meant as a guide to using this book as a "Web programming cook-
book." You may read this Introduction for brief guidelines or go straight to
Chapter 19 if you need an in-depth explanation with a practical example.
Acknowledgments
I'd like to express great thanks to my family first for always being there for
me. I wouldn't be where I am without them, and I'll never manage to thank
them enough for that. To my very close (and special, a.k.a. N.B.) friends, I
thank you for your support and patience over the years; it is not easy putting
up with me for so long, but you have always given me some of the best times
I could hope for. Quick "howdy" to my online friends at COTW and BF2C
for helping me steam off when I had too much work and needed a break.
Thanks to Larry Bernstein for allowing me the opportunity to write this
book, and of course thanks to the people at John Wiley & Sons for getting
my first book published even though I'm still "a kid." Special thanks to
Whitney, Paul and Melissa for all of their help and patience; and to Ben for
the cover image. ©
xv
Introduction
OVERVIEW
You might be wondering why you are reading an "Introduction" chapter and
why this chapter is called "Web Application Recipe." Well, this chapter is
your quick guide to professional Web application design and implementation.
It is in essence a summary of the last chapter of the book (Chapter 19),
created mainly for people with enough experience in Web programming to
skip some of the chapters presented. This chapter will give you the rundown
of the major steps in the lifecycle of a Web project, and will refer to the chap-
ters where you might find more in-depth information on the topics covered.
I call it the "recipe" because it gives you the general layout of what needs to
be done, before getting into the specific details that each individual chapter
will cover. For a more in-depth guideline with a practical example, be sure to
read Chapter 19.
PROCEDURE
Web Application Design and Implementation: Apache 2, PHP5, MySQL, JavtiScript, and
Linux/UNIX, by Steven A. Gabarr6
Copyright © 2007 by John Wiley & Sons, Inc.
1
2 WEB APPLICATION RECIPE
Step 4-Backside
Once the core of the project is up and running, you need to implement the
back end of the project. This is the section of the project that will be used by
administrators to manage the Website after it has been published, and it is a
good idea to have it up and running before the regular users start meddling
with the Web application. If you need some information on writing scripts in
PHP, check out Chapters 5-9.
Step 8-Presentation
Assuming that you are not writing the application for yourself and there is
money involved, you will need to present your final project to your project
sponsor. The key here is to be relaxed and be confident that your project
is rock-solid. If you follow the guidelines in this book, this should not be
a problem. If you are presenting to a nontechnical person, start by showing
the general features of the project, getting into details only when asked to
do so. If you are presenting to a fellow developer, go straight to the
functionalities.
Step 9-Publication
When the project has been approved, it is time to release it. Place it in your
desired host and make sure that everything is set up properly so that users
worldwide can access it. This phase should be fairly fast.
4 WEB APPLICATION RECIPE
Not that long ago, in a galaxy pretty close by, men and women used to live
without practical means of communication. Paper was the main medium used
for information sharing and horses the main carrier for that medium. But
science kept working, and in 1831 Joseph Henry invented the first electric
telegraph. Four years later, Samuel Morse invented the Morse code, and
worked on the very first long-distance electric telegraph line, which he fin-
ished in 1843. A bigger leap in communication progress was made by Alex-
ander Graham Bell, who patented the electric telephone in 1876.Long-distance
communication was finally a reality, but still archaic compared to what was
to be achieved. With the arrival of computers in the midtwentieth century,
people realized the potential of storing and processing data in those amazing
new machines. Furthermore, the United States and the Soviet Union were
deep in the Cold War, and the fear of a possible strike was constantly present
in the military's mind. One of the main concerns was the possibility that all
communication between remote locations could be interrupted by an attack.
Telephone and telegraph lines were out in the open, and could be easily
damaged, so the National Security Agency (NSA) thought of a way to
preserve communications. Emulating the principles of telephone commu-
nication, in the 1960s, the NSA thought of connecting computers through
Web Application Design and Implementation: Apache 2, PHP5, MySQL, JavaScript, and
Linux/UNIX, by Steven A. Gabarr6
Copyright © 2007 by John Wiley & Sons, Inc.
5
Random documents with unrelated
content Scribd suggests to you:
contained not a Constitution, as many so rashly took for granted, but
the promise of Constitutional Government.
I stayed at the Hôtel Dresden, which when I arrived was still
without lamps or light of any kind, and the lift was not working.
The first thing which brought home to me that Russia had been
granted the promise of a Constitution was this. I went to the big
Russian baths. Somebody came in and asked for some soap, upon
which the barber’s assistant, aged about ten, said, with the air of a
Hampden: “Give the citizen some soap” (“Daite grazhdaninu
mwilo”). Coming out of the baths I found the streets decorated with
flags and everybody in a state of frantic and effervescing
enthusiasm. I went to one of the big restaurants. There old men
were embracing each other and drinking the first glass of vodka to
free Russia. After luncheon I went out into the theatre square. There
is a fountain in it, which forms an excellent public platform. An
orator mounted it and addressed the crowd. He began to read the
Emperor’s Manifesto. Then he said: “We are all too much used to the
rascality of the Autocracy to believe this; down with the Autocracy!”
The crowd, infuriated—they were evidently expecting an enthusiastic
eulogy—cried: “Down with you!” But instead of attacking the speaker
who had aroused their indignation they ran away from him! It was a
curious sight. The spectators on the pavement were seized with
panic and ran too. The orator, seeing his speech had missed fire,
changed his tone and said: “You have misunderstood me.” But what
he had said was perfectly clear. This speaker was an ordinary Hyde
Park orator. University professors spoke from the same platform.
Later in the afternoon a procession of students arrived opposite my
hotel with red flags and collected outside the Governor-General’s
house. The Governor-General appeared on the balcony and made a
speech, in which he said that now there were no police he hoped
that they would be able to keep order themselves. He asked them
also to exchange the red flag, which was hanging on the lamp-post
opposite the Palace, for the national flag. One little student climbed
like a monkey up the lamp-post and hung a national flag there, but
did not remove the red flag. Then the Governor asked them to sing
the National Anthem, which they did; and as they went away they
sang the “Marseillaise”:
“Attaquer la Marseillaise en la
Sur les cuivres, pendant que la flute soupire,
En mi bémol: ‘Veillons an salut de l’Empire!’”
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com