PHP, MySQL® & JavaScript® All-in-One For Dummies®

by Richard Blum

Contents at a Glance

Book 1: Getting Started with Web Programming
Examining the Pieces of Web Programming
Using a Web Server
Building a Development Environment
Book 2: HTML5 and CSS3
The Basics of HTML5
The Basics of CSS3
HTML5 Forms
Advanced CSS3.
HTML5 and Multimedia
Book 3: JavaScript
Introducing JavaScript
Advanced JavaScript Coding
Using jQuery
Reacting to Events with JavaScript and jQuery
Troubleshooting JavaScript Programs 
Book 4: PHP
Understanding PHP Basics.
PHP Flow Control
PHP Libraries
Considering PHP Security
Object-Oriented PHP Programming
Sessions and Carts
Book 5: MySQL
Introducing MySQL
Administering MySQL
Designing and Building a Database
Using the Database 
Communicating with the Database from PHP Scripts
Book 6: Creating Object-Oriented Programs
Designing an Object-Oriented Application.
Implementing an Object-Oriented Application
Using AJAX
Extending WordPress 
Book 7: Using PHP Frameworks
The MVC Method.
Selecting a Framework 
Creating an Application Using Frameworks

e-bo4oks shop74
e-bo4oks shop74
Purchase Now !
Just with Paypal



Book Details
 Price
 5.00
 Pages
 795 p
 File Size 
 23,863 KB
 File Type
 PDF format
 ISBN
 978-1-119-46838-7 (pbk)
 978-1-119-46833-2 (ebk)
 978-1-119-46837-0 (ebk)
 Copyright©   
 2018 by John Wiley & Sons, Inc 

Introduction
The Internet has become an amazing place to shop, do your banking, look up
homework assignments, and even keep track of your bowling league scores.
Behind all those great applications are a bunch of different web technologies
that must all work together to create the web experience you come to expect.
You may think that creating web applications is best left for the professionals, but
you’d be surprised by just how well you can do with just a little knowledge and
experience! That’s the point of this book.

About This Book
Think of this book as a reference book. Like the dictionary or an encyclopedia
(remember those?), you don’t have to read it from beginning to end. Instead, you
can dip into the book to find the information you need and return to it again when
you need more. That said, you won’t be disappointed if you work through the book
from beginning to end, and you may find it easier to follow along with some of the examples.

In this book, I walk you through all the different technologies involved with creating
dynamic web applications that can track data and present it in an orderly and
pleasing manner. I cover several key topics that you’ll need to know to create a
full-featured, dynamic web application:
»»Creating the basic layout of a web page: In this book, you see the program
code behind placing content on a web page and reacting to your website
visitors’ mouse clicks.
»»Styling the web page: Just placing data on a web page is boring. In this book,
you learn how to use CSS to help use color, images, and placement to help
liven up your web applications.
»»Adding dynamic features: These days, having a static web page that just sits
there doesn’t get you many followers. This book shows you how to incorporate
JavaScript to animate your web pages and provide dynamic features.
»»Leveraging the power of the server: The PHP programming language allows
you to harness the power behind the web server to dynamically generate web
pages “on the fly” as your website visitors make choices.
»»Storing data for the future: Just about every dynamic web application needs
to store data, and in this book you learn exactly how to do that using the
MySQL server, which is commonly available in just about every web platform.
»»Creating full applications: Many books throw a bunch of technology at you
and expect you to put the pieces together yourself. This book not only shows
you the technology, but also demonstrates how all the parts fit together to
create a dynamic web application.
»»Using helper programs: No one is an island; everyone needs some help
putting together those fancy web applications. There are plenty of tools to
help you get the job done, and with this book you find out which tools will
help you with which features of your application.
Throughout this book you see sidebars (text in gray boxes) and material marked
with the Technical Stuff icon. All of these things are skippable. If you have time
and are interested, by all means read them, but if you don’t or aren’t, don’t.

Finally, within this book, you may note that some web addresses break across two
lines of text. If you’re reading this book in print and want to visit one of these web
pages, simply key in the web address exactly as it’s noted in the text, pretending
as though the line break doesn’t exist. If you’re reading this as an e-book, you’ve
got it easy — just click the web address to be taken directly to the web page.

Table of Contents
INTRODUCTION. 1
About This Book. 1
Foolish Assumptions. 2
Icons Used in This Book. 3
Beyond the Book. 3
Where to Go from Here. 3
BOOK 1: GETTING STARTED WITH
WEB PROGRAMMING. 5
CHAPTER 1: Examining the Pieces of Web Programming. 7
Creating a Simple Web Page. 7
Kicking things off with the World Wide Web. 8
Making sense of markup languages. 9
Retrieving HTML documents. 10
Styling. 14
Creating a Dynamic Web Page . 17
Client-side programming. 19
Server-side programming . 21
Combining client-side and server-side programming.
24
Storing Content. 25
CHAPTER 2: Using a Web Server. 27
Recognizing What’s Required. .27
The web server. 28
The PHP server. 29
The database server. 30
Considering Your Server Options. 31
Using a web-hosting company . 32
Building your own server environment. 33
Using premade servers. 37
Tweaking the Servers. 41
Customizing the Apache Server . 41
Customizing the MySQL server. 44
Customizing the PHP server  .46
CHAPTER 3: Building a Development Environment. 51
Knowing Which Tools to Avoid . 51
Graphical desktop tools. 52
Web-hosting sites . 52
Word processors. 53
Working with the Right Tools. 53
Text editors. 53
Program editors. 61
Integrated development environments. 64
Browser debuggers. 67
BOOK 2: HTML5 AND CSS3. 71
CHAPTER 1: The Basics of HTML5. 73
Diving into Document Structure. 73
Elements, tags, and attributes. 73
Document type . 75
Page definition. 76
Page sections. 78
Looking at the Basic HTML5 Elements. 81
Headings. 81
Text groupings. 82
Breaks. 84
Marking Your Text. 85
Formatting text . 85
Using hypertext. 86
Working with Characters . 90
Character sets . 90
Special characters. 91
Making a List (And Checking It Twice). 92
Unordered lists . 92
Ordered lists. 93
Description lists. 95
Building Tables. 96
Defining a table. 96
Defining the table’s rows and columns . 97
Defining the table headings. 99
CHAPTER 2: The Basics of CSS3. 103
Understanding Styles. 103
Defining the rules of CSS3. 104
Applying style rules. 110
Cascading style rules. 111
Styling Text. 112
Setting the font . 112
Playing with color . 116
Working with the Box Model. 119
Styling Tables. 121
Table borders. 122
Table data. 123
Positioning Elements . 125
Putting elements in a specific place. 128
Floating elements . 130
CHAPTER 3: HTML5 Forms. 135
Understanding HTML5 Forms. 135
Defining a form . 136
Working with form fields . 137
Using Input Fields . 138
Text boxes . 138
Password entry . 140
Check boxes. 141
Radio buttons. 142
Hidden fields . 143
File upload . 144
Buttons. 145
Adding a Text Area . 146
Using Drop-Down Lists. 147
Enhancing HTML5 Forms. 149
Data lists. 149
Additional input fields. 150
Using HTML5 Data Validation . 154
Holding your place . 154
Making certain data required . 155
Validating data types. 155
CHAPTER 4: Advanced CSS3. 157
Rounding Your Corners . 157
Using Border Images 159
Looking at the CSS3 Colors . 162
Playing with Color Gradients. 164
Linear gradients. 164
Radial gradients. 165
Adding Shadows . 166
Text shadows. 166
Box shadows . 167
Creating Fonts. 168
Focusing on font files . 169
Working with web fonts. 169
Handling Media Queries. 171
Using the @media command . 171
Dealing with CSS3 media queries. 172
Applying multiple style sheets. 175
CHAPTER 5: HTML5 and Multimedia. 177
Working with Images . 177
Placing images. 178
Styling images . 179
Linking images. 181
Working with image maps. 182
Using HTML5 image additions. 183
Playing Audio. 185
Embedded audio. 185
Digital audio formats . 186
Audio the HTML5 way. 188
Watching Videos . 190
Paying attention to video quality  .190
Looking at digital video formats. 191
Putting videos in your web page. 192
Getting Help from Streamers . 194
BOOK 3: JAVASCRIPT. 195
CHAPTER 1: Introducing JavaScript. 197
Knowing Why You Should Use JavaScript . 197
Changing web page content . 198
Changing web page styles. 198
Seeing Where to Put Your JavaScript Code. 199
Embedding JavaScript. 199
Using external JavaScript files. 203
The Basics of JavaScript . 203
Working with data. 204
Data types. 205
Arrays of data. 206
Operators. 207
Controlling Program Flow . 209
Conditional statements . 209
Loops. 216
Working with Functions . 220
Creating a function. 221
Using a function. 222
CHAPTER 2: Advanced JavaScript Coding. 223
Understanding the Document Object Model . 223
The Document Object Model tree. 224
JavaScript and the Document Object Model. 226
Finding Your Elements. 233
Getting to the point. 233
Walking the tree. 235
Working with Document Object Model Form Data . 238
Text boxes . 238
Text areas. 239
Check boxes. 240
Radio buttons. 241
CHAPTER 3: Using jQuery. 243
Loading the jQuery Library . 244
Option 1: Downloading the library file to your server. 245
Option 2: Using a content delivery network . 246
Using jQuery Functions  .246
Finding Elements. 247
Replacing Data. 250
Working with text . 250
Working with HTML. 252
Working with attributes . 253
Working with form values . 253
Changing Styles. 254
Playing with properties. 254
Using CSS objects . 256
Using CSS classes. 257
Changing the Document Object Model. 259
Adding a node. 259
Removing a node. 260
Playing with Animation. 261
CHAPTER 4: Reacting to Events with JavaScript and jQuery . 263
Understanding Events . 263
Event-driven programming . 264
Watching the mouse. 264
Listening for keystrokes. 265
Paying attention to the page itself . 266
Focusing on JavaScript and Events. 267
Saying hello and goodbye . 267
Listening for mouse events. 269
Listening for keystrokes. 273
Event listeners. 275
Looking at jQuery and Events. 276
jQuery event functions. 276
The jQuery event handler. 280
CHAPTER 5: Troubleshooting JavaScript Programs. 283
Identifying Errors. 283
Working with Browser Developer Tools. 285
The DOM Explorer. 286
The Console. 287
The Debugger. 290
Working Around Errors. 295
BOOK 4: PHP. 301
CHAPTER 1: Understanding PHP Basics. 303
Seeing the Benefits of PHP. 303
A centralized programming language . 304
Centralized data management . 304
Understanding How to Use PHP. 305
Embedding PHP code. 305
Identifying PHP pages. 306
Displaying output . 307
Handling new-line characters . 309
Working with PHP Variables. 310
Declaring variables . 311
Seeing which data types PHP supports. 312
Grouping data values with array variables . 315
Using PHP Operators . 317
Arithmetic operators. 317
Arithmetic shortcuts. 318
Boolean operators. 319
String operators. 320
Including Files . 320
The include() function. 320
The require() function. 323
CHAPTER 2: PHP Flow Control. 325
Using Logic Control. 325
The if statement. 326
The else statement. 328
The elseif statement. 328
The switch statement. 330
Looping. 331
The while family. 331
The for statement. 333
The foreach statement. 334
Building Your Own Functions . 336
Working with Event-Driven PHP . 339
Working with links. 339
Processing form data . 343
CHAPTER 3: PHP Libraries. 349
How PHP Uses Libraries. 349
Exploring PHP extensions . 350
Examining the PHP extensions. 351
Including extensions. 353
Adding additional extensions . 354
Text Functions. 354
Altering string values. .354
Splitting strings . 356
Testing string values. 359
Searching strings. 360
Math Functions . 361
Number theory . 361
Calculating logs and exponents. 362
Working the angles. 363
Hyperbolic functions. 364
Tracking statistics . 364
Date and Time Functions. 365
Generating dates. 365
Using timestamps. 367
Calculating dates. 368
Image-Handling Functions. 369
CHAPTER 4: Considering PHP Security. 375
Exploring PHP Vulnerabilities . 375
Cross-site scripting . 376
Data spoofing. 379
Invalid data. 380
Unauthorized file access .382
PHP Vulnerability Solutions. 384
Sanitizing data. 384
Validating data. 389
CHAPTER 5: Object-Oriented PHP Programming. 395
Understanding the Basics of Object-Oriented Programming. 395
Defining a class . 396
Creating an object instance. 397
Using Magic Class Methods. 401
Defining mutator magic methods. 401
Defining accessor magic methods . 403
The constructor. 406
The destructor. 407
Copying objects. 408
Displaying objects. 408
Loading Classes. 409
Extending Classes. 414
CHAPTER 6: Sessions and Carts. 419
Storing Persistent Data. 419
The purpose of HTTP cookies . 420
Types of cookies . 421
The anatomy of a cookie . 422
Cookie rules. 424
PHP and Cookies. 424
Setting cookies. 424
Reading cookies. 426
Modifying and deleting cookies. 428
PHP and Sessions . 430
Starting a session. 431
Storing and retrieving session data . 431
Removing session data. 435
Shopping Carts. 436
Creating a cart. 436
Placing items in the cart. 437
Retrieving items from a cart . 437
Removing items from a cart. 438
Putting it all together . 438
BOOK 5: MYSQL. 443
CHAPTER 1: Introducing MySQL. 445
Seeing the Purpose of a Database. 445
How databases work. 446
Relational databases. 449
Database data types. 451
Data constraints. 451
Structured Query Language. 452
Presenting MySQL. 454
MySQL features. 454
Storage engines. 456
Data permissions. 457
Advanced MySQL Features . 458
Handling transactions. 458
Making sure your database is ACID compliant. 459
Examining the views. 461
Working with stored procedures 462
Pulling triggers. 463
Working with blobs. 463
CHAPTER 2: Administering MySQL. 465
MySQL Administration Tools. 465
Working from the command line . 466
Using MySQL Workbench. 470
Using the phpMyAdmin tool . 475
Managing User Accounts. 477
Creating a user account. 477
Managing user privileges. 481
CHAPTER 3: Designing and Building a Database. 489
Managing Your Data. 489
The first normal form. 490
The second normal form. 491
The third normal form . 491
Creating Databases. 492
Using the MySQL command line. 492
Using MySQL Workbench. 495
Using phpMyAdmin. 497
Building Tables. 500
Working with tables using the command-line interface . 500
Working with tables using Workbench. 505
Working with tables in phpMyAdmin. 508
CHAPTER 4: Using the Database . 513
Working with Data. 513
The MySQL command-line interface . 514
The MySQL Workbench tool . 519
The phpMyAdmin tool . 522
Searching for Data. 524
The basic SELECT format . 525
More advanced queries. 527
Playing It Safe with Data. 531
Performing data backups. 532
Restoring your data. 538
CHAPTER 5: Communicating with the Database from PHP
Scripts . 541
Database Support in PHP. 541
Using the mysqli Library. 543
Connecting to the database. 544
Closing the connection. 545
Submitting queries . 546
Retrieving data. 547
Being prepared . 549
Checking for errors. 551
Miscellaneous functions. 553
Putting It All Together. 554
BOOK 6: CREATING OBJECT-ORIENTED PROGRAMS. 561
CHAPTER 1: Designing an Object-Oriented Application. 563
Determining Application Requirements. 563
Creating the Application Database. 565
Designing the database . 565
Creating the database. 568
Designing the Application Objects . 571
Designing objects . 571
Coding the objects in PHP . 573
Designing the Application Layout. 579
Designing web page layout . 580
The AuctionHelper page layout. 581
Coding the Website Layout . 582
Creating the web page template. 582
Creating the support files. 587
CHAPTER 2: Implementing an Object-Oriented Application. 593
Working with Events. 593
Bidder Object Events. 595
Listing bidders. 595
Adding a new bidder. 603
Searching for a bidder . 605
Item Object Events . 605
Listing items. 606
Adding a new item. 611
Searching for an item. 614
Logging Out of a Web Application. 614
Testing Web Applications. 616
CHAPTER 3: Using AJAX. 619
Getting to Know AJAX . 619
Communicating Using JavaScript . 621
Considering XMLHttpRequest class methods. 622
Focusing on XMLHttpRequest class properties. 623
Trying out AJAX. 625
Using the jQuery AJAX Library. 629
The jQuery $.ajax() function. 629
The jQuery $.get() function. .633
Transferring Data in AJAX. 635
Looking at the XML standard. 635
Using XML in PHP . 636
Using XML in JavaScript. 640
Modifying the AuctionHelper Application. 643
CHAPTER 4: Extending WordPress. 651
Getting Acquainted with WordPress. 651
What WordPress can do for you. 652
How to run WordPress. 653
Parts of a WordPress website. 654
Installing WordPress. 655
Downloading the WordPress software. 655
Creating the database objects. 656
Configuring WordPress. 658
Examining the Dashboard. 662
Using WordPress. 664
Exploring the World of Plugins . 669
WordPress APIs. 670
Working with plugins and widgets . 671
Creating Your Own Widget. 674
Coding the widget. 674
Activating the widget plugin. 676
Adding the widget. 677
BOOK 7: USING PHP FRAMEWORKS. 681
CHAPTER 1: The MVC Method 683
Getting Acquainted with MVC. 683
Exploring the MVC method . 684
Digging into the MVC components. 686
Communicating in MVC . 690
Comparing MVC to Other Web Models. 691
The MVP method. 692
The MVVM method. 692
Seeing How MVC Fits into N-Tier Theory. 693
Implementing MVC. 694
CHAPTER 2: Selecting a Framework. 695
Getting to Know PHP Frameworks. 695
Convention over configuration. 696
Scaffolding . 698
Routing. 699
Helper methods. 700
Form validation. 700
Support for mobile devices. 700
Templates. 701
Unit testing. 701
Knowing Why You Should Use a Framework . 702
Focusing on Popular PHP Frameworks . 704
CakePHP. 704
CodeIgniter. 705
Laravel. 707
Symfony . 708
Zend Framework. 709
Looking At Micro Frameworks. 710
Lumen. 710
Slim . 711
Yii. 713
CHAPTER 3: Creating an Application Using Frameworks. 715
Building the Template. 715
Initializing the application . 716
Exploring the files and folders. 718
Defining the database environment. 719
Creating an Application Scaffold. 721
Installing the scaffolding. 721
Exploring the scaffolding code . 724
Modifying the Application Scaffold. 725
Adding a new feature link 726
Creating the controller code . 728
Modifying the model code. 730
Painting a view. 731
INDEX. 735


Bookscreen
e-books shop

Foolish Assumptions
You don’t need any level of programming experience to enjoy this book and start
creating your own web applications. Each chapter walks through all the basics you
need to know and doesn’t assume you’ve ever coded before. As long as you’re reasonably
comfortable navigating your way around a standard desktop computer,
you have all the experience you need!

That said, if you’ve already tried your hand at web programming and you just
want to fill in a few holes, this book will work well for you, too!
This book doesn’t expect you to run out and buy any expensive software packages
to start your web development career. All the tools that are used in the book are
freely available open-source software. I walk you through how to set up a complete
development environment, whether you’re working in Microsoft Windows,
Apple macOS, or Linux.
Previous Post Next Post