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

724 Pages · 13.86 mb ·

Technology Software

Table of contents

- PHP, MySQL, JavaScript & HTML5 All-In-One For Dummies (Page 1)
- About the Authors (Page 7)
- Dedication (Page 9)
- Authors’ Acknowledgments (Page 9)
- Contents at a Glance (Page 11)
- Table of Contents (Page 13)
- Introduction (Page 27)
- About This Book (Page 27)
- Foolish Assumptions (Page 27)
- How This Book Is Organized (Page 28)
- Icons Used in This Book (Page 29)
- Where to Go from Here (Page 29)
- CoCnotnetnetns tas ta at aG lGalnacnece (Page 32)
- Book I: Getting Started with PHP & MySQL (Page 31)
- Chapter 1: Understanding the Languages of the Web (Page 33)
- Understanding How the Web Works (Page 33)
- Understanding Web Page Languages (Page 36)
- Understanding the Language of Web Servers (Page 38)
- Choosing How You Want to Develop (Page 40)
- Setting Up Your Local Computer for Development (Page 45)
- Chapter 2: Installing a Web Server (Page 47)
- Testing Your Web Server (Page 47)
- Obtaining Apache (Page 48)
- Installing Apache (Page 51)
- Starting and Stopping Apache (Page 54)
- Getting Information from Apache (Page 57)
- Configuring Apache (Page 58)
- Chapter 3: Installing PHP (Page 61)
- Checking the PHP Installation (Page 62)
- Obtaining PHP (Page 62)
- Installing PHP (Page 66)
- Configuring Your Web Server for PHP (Page 73)
- Configuring PHP (Page 76)
- Testing PHP (Page 77)
- Troubleshooting (Page 79)
- Chapter 4: Setting Up MySQL (Page 81)
- Checking the MySQL Installation (Page 81)
- Obtaining MySQL (Page 83)
- Installing MySQL (Page 85)
- Configuring MySQL (Page 91)
- Starting and Stopping the MySQL Server (Page 92)
- Testing MySQL (Page 94)
- Troubleshooting MySQL (Page 95)
- The MySQL Administration Program (Page 96)
- Activating MySQL Support (Page 97)
- Troubleshooting PHP and MySQL (Page 99)
- Chapter 5: Setting Up Your Web Development Environment with the XAMPP Package (Page 101)
- Obtaining XAMPP (Page 101)
- Installing XAMPP (Page 102)
- Using the XAMPP Control Panel (Page 104)
- Testing Your Development Environment (Page 105)
- Configuring Your Development Environment (Page 108)
- Uninstalling and Reinstalling XAMPP (Page 110)
- Troubleshooting (Page 111)
- CoCnotnetnetns tas ta at aG lGalnacnece (Page 114)
- Book II: HTML and CSS (Page 113)
- Chapter 1: Creating a Basic Page with HTML (Page 115)
- Understanding the HTML Building Blocks (Page 115)
- Sections of an HTML Document (Page 117)
- Creating Good HTML (Page 120)
- Practicing Creating a Table (Page 131)
- Including Links and Images on Your Web Page (Page 134)
- Writing Valid HTML (Page 142)
- Validating Your HTML (Page 143)
- Chapter 2: Adding Style with CSS (Page 147)
- Discovering What CSS Can and Can’t Do for Your Web Page (Page 147)
- Connecting CSS to a Page (Page 149)
- Targeting Styles (Page 155)
- Changing Fonts (Page 160)
- Adding Borders (Page 166)
- Changing List Styles (Page 170)
- Adding a Background (Page 173)
- Creating Page Layouts (Page 181)
- Adding Headers and Footers to a Page (Page 189)
- Chapter 3: Creating and Styling Web Forms (Page 195)
- Using Web Forms to Get Information (Page 195)
- Creating a Form (Page 198)
- Using CSS to Align Form Fields (Page 206)
- CoCnotnetnetns tas ta at aG lGalnacnece (Page 212)
- Book III: JavaScript (Page 211)
- Chapter 1: Understanding JavaScript Basics (Page 213)
- Viewing the World of JavaScript (Page 213)
- Examining the Ways to Add JavaScript to a Page (Page 214)
- Chapter 2: Building a JavaScript Program (Page 217)
- Getting Started with JavaScript Programming (Page 217)
- Testing Things with Conditionals (Page 223)
- Performing Actions Multiple Times with Loops (Page 226)
- Using Functions to Avoid Repeating Yourself (Page 229)
- Objects in Brief (Page 234)
- Working with HTML Documents (Page 236)
- Working with Web Browsers (Page 240)
- Chapter 3: Adding jQuery (Page 245)
- jQuery Introduced (Page 245)
- Installing jQuery (Page 246)
- Adding jQuery to a Page (Page 247)
- Incorporating the jQuery ready() Function (Page 249)
- Selecting Elements with jQuery (Page 251)
- Working with HTML Using jQuery (Page 253)
- Changing Attributes and Styles (Page 258)
- Chapter 4: Reacting to Events with JavaScript and jQuery (Page 267)
- Understanding Events (Page 267)
- Working with Forms (Page 268)
- Monitoring Mouse Events (Page 273)
- Reacting to Keyboard Events (Page 280)
- Chapter 5: Troubleshooting JavaScript Programs (Page 287)
- Employing Basic JavaScript Troubleshooting Techniques (Page 287)
- Identifying JavaScript Problems with Firebug (Page 290)
- CoCnotnetnetns tas ta at aG lGalnacnece (Page 296)
- Book IV: PHP (Page 295)
- Chapter 1: Understanding PHP Basics (Page 297)
- How PHP Works (Page 297)
- Examining the Structure of a PHP Script (Page 299)
- Looking at PHP Syntax (Page 301)
- Writing PHP Code (Page 303)
- Displaying Content in a Web Page (Page 304)
- Using PHP Variables (Page 307)
- Using PHP Constants (Page 313)
- Understanding Data Types (Page 314)
- Using Arrays (Page 322)
- Using Dates and Times (Page 333)
- Understanding PHP Error Messages (Page 336)
- Adding Comments to Your PHP Script (Page 342)
- Chapter 2: Building PHP Scripts (Page 345)
- Setting Up Conditions (Page 346)
- Using Conditional Statements (Page 355)
- Repeating Actions with Loops (Page 361)
- Using Functions (Page 372)
- Organizing Scripts (Page 383)
- Chapter 3: PHP and Your Operating System (Page 391)
- Managing Files (Page 392)
- Using Operating System Commands (Page 398)
- Using FTP (Page 404)
- Reading and Writing Files (Page 409)
- Exchanging Data with Other Programs (Page 416)
- Using SQLite (Page 420)
- Chapter 4: Object-Oriented Programming (Page 423)
- Introducing Object-Oriented Programming (Page 423)
- Developing an Object-Oriented Script (Page 426)
- Defining a Class (Page 428)
- Using a Class in a Script (Page 439)
- Using Abstract Methods in Abstract Classes and Interfaces (Page 441)
- Preventing Changes to a Class or Method (Page 444)
- Handling Errors with Exceptions (Page 445)
- Copying Objects (Page 446)
- Comparing Objects (Page 447)
- Getting Information about Objects and Classes (Page 448)
- Destroying Objects (Page 449)
- Chapter 5: Considering PHP Security (Page 451)
- Securing the Server (Page 451)
- Securing Apache (Page 452)
- Setting Security Options in php. ini (Page 454)
- Handling Errors Safely (Page 455)
- Sanitizing Variables (Page 458)
- Chapter 6: Tracking Visitors with Sessions (Page 463)
- Understanding Sessions and Cookies (Page 463)
- Using Sessions to Pass Data (Page 466)
- Understanding Other Session Options (Page 472)
- CoCnotnetnetns tas ta at aG lGalnacnece (Page 474)
- Book V: MySQL (Page 473)
- Chapter 1: Introducing MySQL (Page 475)
- Examining How MySQL Works (Page 475)
- Understanding Database Structure (Page 476)
- Communicating with MySQL (Page 476)
- Protecting Your MySQL Databases (Page 480)
- Chapter 2: Administering MySQL (Page 483)
- Understanding the Administrator Responsibilities (Page 483)
- Default Access to Your Data (Page 484)
- Controlling Access to Your Data (Page 485)
- Setting Up MySQL Accounts (Page 488)
- Backing Up Your Database (Page 494)
- Restoring Your Data (Page 497)
- Upgrading MySQL (Page 499)
- Chapter 3: Designing and Building a Database (Page 501)
- Designing a Database (Page 501)
- Designing a Sample Database (Page 510)
- Writing Down Your Design (Page 513)
- Building a Database (Page 515)
- Changing the Database Structure (Page 520)
- Chapter 4: Using the Database (Page 523)
- Adding Information to a Database (Page 524)
- Looking at the Data in a Database (Page 528)
- Retrieving Information from a Database (Page 528)
- Updating Information in a Database (Page 539)
- Removing Information from a Database (Page 539)
- Chapter 5: Communicating with the Database from PHP Scripts (Page 541)
- Knowing How MySQL and PHP Work Together (Page 541)
- PHP Functions That Communicate with MySQL (Page 542)
- Communicating with MySQL (Page 542)
- Selecting a Database (Page 547)
- Handling MySQL Errors (Page 548)
- Using Other Helpful mysqli Functions (Page 549)
- Converting mysqli Functions to mysql Functions (Page 552)
- CoCnotnetnetns tas ta at aG lGalnacnece (Page 556)
- Book VI: Web Applications (Page 555)
- Chapter 1: Improving Your PHP Programs (Page 557)
- Automatically Including Helper Functions (Page 557)
- Reusing Code (Page 561)
- Chapter 2: Creating and Using a Web Service (Page 567)
- Understanding Web Services (Page 567)
- Returning Data from a Web Service (Page 568)
- Accepting Input to a Web Service (Page 574)
- Chapter 3: Validating Web Forms with JavaScript and PHP (Page 581)
- Understanding How to Validate Web Forms (Page 581)
- Performing Basic JavaScript Validation (Page 583)
- Performing PHP Validation (Page 600)
- Chapter 4: Building a Members-Only Website (Page 613)
- Understanding a Members-Only Site (Page 614)
- Creating the User Database (Page 615)
- Creating Base Functions (Page 617)
- Creating Web Forms (Page 619)
- Creating a User Object (Page 633)
- Adding Authenticated Pages (Page 638)
- Adding E-mail Functionality (Page 644)
- CoCnotnetnetns tas ta at aG lGalnacnece (Page 660)
- Book VII: PHP and Templates (Page 659)
- Chapter 1: Configuring PHP (Page 661)
- Understanding the php. ini (Page 661)
- Understanding Common Configuration Changes (Page 662)
- Chapter 2: Building a Templating System (Page 667)
- Understanding Template Systems (Page 667)
- Building a PHP Template (Page 668)
- Extending the Template (Page 676)
- Symbols (Page 681)
- A (Page 681)
- B (Page 683)
- C (Page 684)
- D (Page 687)
- E (Page 689)
- F (Page 690)
- G (Page 694)
- H (Page 694)
- I (Page 695)
- J (Page 696)
- K (Page 697)
- L (Page 698)
- M (Page 699)
- N (Page 701)
- O (Page 702)
- P (Page 704)
- Q (Page 708)
- R (Page 708)
- S (Page 709)
- T (Page 712)
- U (Page 714)
- V (Page 714)
- W (Page 715)
- X (Page 717)
- Y (Page 718)
- Z (Page 718)
- Index (Page 681)