Home » , , » PHP, MySQL, JavaScript & HTML5 All-In-One For Dummies

PHP, MySQL, JavaScript & HTML5 All-In-One For Dummies



Contents at a Glance
Introduction ................................................................ 1
Book I: Getting Started with PHP & MySQL................... 5
Chapter 1: Understanding the Languages of the Web...................................................7
Chapter 2: Installing a Web Server ................................................................................21
Chapter 3: Installing PHP ................................................................................................35
Chapter 4: Setting Up MySQL .........................................................................................55
Chapter 5: Setting Up Your Web Development Environment
with the XAMPP Package..............................................................................................75
Book II: HTML and CSS.............................................. 87
Chapter 1: Creating a Basic Page with HTML...............................................................89
Chapter 2: Adding Style with CSS ................................................................................121
Chapter 3: Creating and Styling Web Forms...............................................................169
Book III: JavaScript................................................. 185
Chapter 1: Understanding JavaScript Basics .............................................................187
Chapter 2: Building a JavaScript Program..................................................................191
Chapter 3: Adding jQuery .............................................................................................219
Chapter 4: Reacting to Events with JavaScript and jQuery......................................241
Chapter 5: Troubleshooting JavaScript Programs ....................................................261
Book IV: PHP .......................................................... 269
Chapter 1: Understanding PHP Basics ........................................................................271
Chapter 2: Building PHP Scripts...................................................................................319
Chapter 3: PHP and Your Operating System..............................................................365
Chapter 4: Object-Oriented Programming..................................................................397
Chapter 5: Considering PHP Security..........................................................................425
Chapter 6: Tracking Visitors with Sessions................................................................437
Book V: MySQL ....................................................... 447
Chapter 1: Introducing MySQL.....................................................................................449
Chapter 2: Administering MySQL ................................................................................457
Chapter 3: Designing and Building a Database ..........................................................475
Chapter 4: Using the Database.....................................................................................497
Chapter 5: Communicating with the Database from PHP Scripts............................515
Book VI: Web Applications....................................... 529
Chapter 1: Improving Your PHP Programs.................................................................531
Chapter 2: Creating and Using a Web Service............................................................541
Chapter 3: Validating Web Forms with JavaScript and PHP ....................................555
Chapter 4: Building a Members-Only Website ...........................................................587
Book VII: PHP and Templates................................... 633
Chapter 1: Configuring PHP..........................................................................................635
Chapter 2: Building a Templating System...................................................................641
Index ...................................................................... 655

Table of Contents
Introduction ................................................................. 1
About This Book ..............................................................................................1
Foolish Assumptions.......................................................................................1
How This Book Is Organized..........................................................................2
Book I: Getting Started with PHP and MySQL ....................................2
Book II: HTML and CSS..........................................................................2
Book III: JavaScript ................................................................................2
Book IV:PHP............................................................................................2
Book V: MySQL.......................................................................................2
Book VI: Web Applications ...................................................................2
Book VII: PHP and Templates...............................................................2
Companion Website ..............................................................................3
Icons Used in This Book .................................................................................3
Where to Go from Here...................................................................................3
Book I: Getting Started with PHP & MySQL ................... 5
Chapter 1: Understanding the Languages of the Web . . . . . . . . . . . . . . 7
Understanding How the Web Works.............................................................7
The web browser ...................................................................................8
The web server.......................................................................................8
Understanding Web Page Languages..........................................................10
Marking up with HTML........................................................................10
Styling pages with CSS.........................................................................11
Changing behaviors with JavaScript.................................................11
Understanding the Language of Web Servers............................................12
Building dynamic web applications with PHP and MySQL.............12
Sending the page to the browser with Apache ................................13
Choosing How You Want to Develop..........................................................14
Choosing a host for your website......................................................14
Hosting for a company website..........................................................15
Choosing a web-hosting company.....................................................16
Using a hosted website .......................................................................18
Setting Up Your Local Computer for Development...................................19
Installing the web server.....................................................................19
Installing PHP .......................................................................................20
Installing MySQL ..................................................................................20
xii PHP, MySQL, JavaScript & HTML5 All-in-One For Dummies
Chapter 2: Installing a Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Testing Your Web Server..............................................................................21
Obtaining Apache ..........................................................................................22
Selecting a version of Apache ............................................................22
Downloading from the Apache website ............................................23
Obtaining Apache for Windows .........................................................23
Obtaining Apache for Linux................................................................23
Obtaining Apache for Mac ..................................................................24
Obtaining all-in-one installation kits..................................................24
Verifying a downloaded file ................................................................24
Installing Apache ...........................................................................................25
Installing Apache on Windows...........................................................25
Installing Apache on a Mac.................................................................27
Installing Apache from source code on Linux and Mac..................27
Starting and Stopping Apache .....................................................................28
Starting and stopping Apache on Windows .....................................28
Starting Apache on Linux, Unix, and Mac.........................................29
Restarting Apache on Linux, Unix, and Mac.....................................30
Stopping Apache on Linux, Unix, and Mac .......................................30
Getting Information from Apache................................................................31
Getting Apache information on Windows.........................................31
Getting Apache information on Linux, Unix, and Mac ....................31
Configuring Apache.......................................................................................32
Changing settings.................................................................................32
Changing the location of your Document Root................................33
Changing the port number .................................................................33
Chapter 3: Installing PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Checking the PHP Installation......................................................................36
Obtaining PHP................................................................................................36
Downloading from the PHP website..................................................37
Obtaining PHP for Windows ...............................................................37
Obtaining PHP for Linux......................................................................37
Obtaining PHP for the Mac OS ...........................................................38
Obtaining all-in-one installation kits..................................................38
Verifying a downloaded file ................................................................39
Installing PHP.................................................................................................40
Installing on Unix and Linux ...............................................................40
Installing on Mac OS X.........................................................................42
Installation options for Unix, Linux, and Mac ..................................44
Installing on Windows .........................................................................46
Configuring Your Web Server for PHP........................................................47
Configuring your web server on Windows .......................................47
Configuring Apache on Linux and Mac .............................................49
Configuring PHP.............................................................................................50


Table of Contents xiii
Testing PHP....................................................................................................51
Troubleshooting ............................................................................................53
Unable to change PHP settings ..........................................................53
Displays error message: Undefined function ...................................53
Displays a blank page or HTML output only....................................53
Chapter 4: Setting Up MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Checking the MySQL Installation.................................................................55
Finding out if MySQL is running or installed....................................56
Starting MySQL.....................................................................................56
Obtaining MySQL...........................................................................................57
Downloading from the MySQL website.............................................58
Obtaining MySQL for Windows..........................................................58
Obtaining MySQL for Linux and Unix................................................58
Obtaining MySQL for Mac...................................................................59
Obtaining all-in-one installation kits..................................................59
Verifying a downloaded file ................................................................59
Installing MySQL............................................................................................59
Running the MySQL Setup Wizard on Windows ..............................60
Installing MySQL on Linux from an RPM file ....................................61
Installing MySQL on Mac from a DMG file ........................................62
Installing MySQL from source files....................................................63
Configuring MySQL........................................................................................65
Starting and Stopping the MySQL Server ...................................................66
Controlling the server on Windows...................................................66
Controlling the MySQL server on Linux and Mac............................67
Testing MySQL...............................................................................................68
Troubleshooting MySQL...............................................................................69
Displays error message: Access denied............................................69
Displays error message: Client does not support
authentication protocol ..................................................................69
Displays error message: Can’t connect to . . ...................................70
MySQL error log...................................................................................70
The MySQL Administration Program..........................................................70
Activating MySQL Support...........................................................................71
Activating MySQL support on Windows...........................................71
Activating MySQL support on Linux and the Mac OS .....................71
Checking MySQL support ...................................................................72
Troubleshooting PHP and MySQL...............................................................73
Displays error message: Undefined function ...................................73
MySQL functions not activated (Windows)......................................74
Chapter 5: Setting Up Your Web Development Environment
with the XAMPP Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Obtaining XAMPP ..........................................................................................75
Installing XAMPP ...........................................................................................76
xvi PHP, MySQL, JavaScript & HTML5 All-in-One For Dummies
Chapter 2: Building a JavaScript Program . . . . . . . . . . . . . . . . . . . . . 191
Getting Started with JavaScript Programming.........................................191
Sending an alert to the screen..........................................................191
Adding comments..............................................................................193
Holding data for later in variables...................................................193
Holding multiple values in an array.................................................195
Creating strings to keep track of words..........................................195
Working with numbers......................................................................196
Testing Things with Conditionals..............................................................197
Performing Actions Multiple Times with Loops......................................200
For what it’s worth ............................................................................200
While you’re here...............................................................................203
Using Functions to Avoid Repeating Yourself .........................................203
Creating functions..............................................................................204
Adding function arguments ..............................................................204
Calling a function ...............................................................................204
Improving the addNumbers function..............................................205
Returning results from functions.....................................................207
Objects in Brief ............................................................................................208
Creating objects .................................................................................208
Adding properties to objects ...........................................................209
Working with HTML Documents................................................................210
Accessing HTML with JavaScript.....................................................211
Using GetElementById to access a specific element.....................211
Working with Web Browsers......................................................................214
Detecting the browser.......................................................................214
Redirecting to another page.............................................................216
Chapter 3: Adding jQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
jQuery Introduced .......................................................................................219
Installing jQuery...........................................................................................220
Installing jQuery locally ....................................................................220
Using CDN-hosted jQuery .................................................................221
Adding jQuery to a Page .............................................................................221
Adding local jQuery to a page ..........................................................221
Adding CDN jQuery to a page...........................................................222
Incorporating the jQuery ready() Function .............................................223
Selecting Elements with jQuery.................................................................225
jQuery selectors up close .................................................................226
Filtering ...............................................................................................227
Working with HTML Using jQuery.............................................................227
Adding HTML to a page.....................................................................227
Changing elements.............................................................................230
Changing Attributes and Styles .................................................................232
Reading attributes .............................................................................233
Writing attributes...............................................................................234
Changing CSS......................................................................................237
FREE DOWNLOAD

0 Comments:

Publicar un comentario

Popular Posts

Popular Posts