1. Trang chủ
  2. » Công Nghệ Thông Tin

PHP, MySQL javascript all in one for dummies

795 300 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 795
Dung lượng 23,31 MB

Nội dung

PHP, MySQL & JavaScript ® ® ALL-IN-ONE by Richard Blum PHP, MySQL® & JavaScript® All-in-One For Dummies® Published by: John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, www.wiley.com Copyright © 2018 by John Wiley & Sons, Inc., Hoboken, New Jersey Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the Publisher Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/ permissions Trademarks: Wiley, For Dummies, the Dummies Man logo, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc and may not be used without written permission MySQL is a registered trademark of MySQL AB. JavaScript is a registered trademark of Oracle America, Inc All other trademarks are the property of their respective owners John Wiley & Sons, Inc is not associated with any product or vendor mentioned in this book LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE.  NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES.  IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM.  THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ For general information on our other products and services, please contact our Customer Care Department within the U.S at 877-762-2974, outside the U.S at 317-572-3993, or fax 317-572-4002 For technical support, please visit https://hub.wiley.com/community/support/dummies Wiley publishes in a variety of print and electronic formats and by print-on-demand Some material included with standard print versions of this book may not be included in e-books or in print-on-demand If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com For more information about Wiley products, visit www.wiley.com Library of Congress Control Number: 2018933793 ISBN 978-1-119-46838-7 (pbk); ISBN 978-1-119-46833-2 (ebk); ISBN 978-1-119-46837-0 (ebk) Manufactured in the United States of America 10 Contents at a Glance Introduction Book 1: Getting Started with Web Programming CHAPTER 1: Examining the Pieces of Web Programming CHAPTER 2: Using a Web Server 27 CHAPTER 3: Building a Development Environment 51 Book 2: HTML5 and CSS3 71 CHAPTER 1: The Basics of HTML5 73 The Basics of CSS3 103 CHAPTER 3: HTML5 Forms 135 CHAPTER 4: Advanced CSS3 157 CHAPTER 5: HTML5 and Multimedia 177 CHAPTER 2: Book 3: JavaScript CHAPTER 1: 195 Introducing JavaScript Advanced JavaScript Coding Using jQuery Reacting to Events with JavaScript and jQuery Troubleshooting JavaScript Programs 197 223 243 263 283 Book 4: PHP 301 CHAPTER 2: CHAPTER 3: CHAPTER 4: CHAPTER 5: CHAPTER 1: Understanding PHP Basics 303 CHAPTER 2: PHP Flow Control PHP Libraries CHAPTER 4: Considering PHP Security CHAPTER 5: Object-Oriented PHP Programming CHAPTER 6: Sessions and Carts 325 349 375 395 419 Book 5: MySQL 443 CHAPTER 3: CHAPTER 1: Introducing MySQL 445 Administering MySQL 465 CHAPTER 3: Designing and Building a Database 489 CHAPTER 4: Using the Database 513 CHAPTER 5: Communicating with the Database from PHP Scripts 541 CHAPTER 2: Book 6: Creating Object-Oriented Programs CHAPTER 1: 561 Designing an Object-Oriented Application CHAPTER 2: Implementing an Object-Oriented Application CHAPTER 3: Using AJAX CHAPTER 4: Extending WordPress 563 593 619 651 Book 7: Using PHP Frameworks 681 CHAPTER 1: The MVC Method 683 Selecting a Framework 695 CHAPTER 3: Creating an Application Using Frameworks 715 CHAPTER 2: Index 735 Table of Contents INTRODUCTION About This Book Foolish Assumptions Icons Used in This Book Beyond the Book Where to Go from Here 3 BOOK 1: GETTING STARTED WITH WEB PROGRAMMING CHAPTER 1: Examining the Pieces of Web Programming Creating a Simple Web Page Kicking things off with the World Wide Web Making sense of markup languages 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 Graphical desktop tools Web-hosting sites Word processors Table of Contents 51 52 52 53 v Working with the Right Tools Text editors Program editors Integrated development environments Browser debuggers 53 53 61 64 67 BOOK 2: HTML5 AND CSS3 71 CHAPTER 1: The Basics of HTML5 73 Diving into Document Structure Elements, tags, and attributes Document type Page definition Page sections Looking at the Basic HTML5 Elements Headings Text groupings Breaks Marking Your Text Formatting text Using hypertext Working with Characters Character sets Special characters Making a List (And Checking It Twice) Unordered lists Ordered lists Description lists Building Tables Defining a table Defining the table’s rows and columns Defining the table headings CHAPTER 2: vi 73 73 75 76 78 81 81 82 84 85 85 86 90 90 91 92 92 93 95 96 96 97 99 The Basics of CSS3 103 Understanding Styles Defining the rules of CSS3 Applying style rules Cascading style rules Styling Text Setting the font Playing with color Working with the Box Model Styling Tables Table borders Table data 103 104 110 111 112 112 116 119 121 122 123 PHP, MySQL & JavaScript All-in-One For Dummies Positioning Elements 125 Putting elements in a specific place 128 Floating elements 130 CHAPTER 3: CHAPTER 4: HTML5 Forms 135 Understanding HTML5 Forms Defining a form Working with form fields Using Input Fields Text boxes Password entry Check boxes Radio buttons Hidden fields File upload Buttons Adding a Text Area Using Drop-Down Lists Enhancing HTML5 Forms Data lists Additional input fields Using HTML5 Data Validation Holding your place Making certain data required Validating data types 135 136 137 138 138 140 141 142 143 144 145 146 147 149 149 150 154 154 155 155 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 Table of Contents vii 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 Introducing JavaScript 197 Knowing Why You Should Use JavaScript Changing web page content Changing web page styles Seeing Where to Put Your JavaScript Code Embedding JavaScript Using external JavaScript files The Basics of JavaScript Working with data Data types Arrays of data Operators Controlling Program Flow Conditional statements Loops Working with Functions Creating a function Using a function 197 198 198 199 199 203 203 204 205 206 207 209 209 216 220 221 222 Advanced JavaScript Coding 223 CHAPTER 1: CHAPTER 2: Understanding the Document Object Model 223 The Document Object Model tree 224 JavaScript and the Document Object Model 226 viii PHP, MySQL & JavaScript All-in-One For Dummies pattern property, 239 pc absolute units of measurement, 114 data spoofing, 379–380 PCRE (Perl Compatible Regular Expressions), 361 overview, 375–376 PDF (Portable Document Format), 538 file access, unauthorized, 382–383 solutions, 384–394 PDO (PHP Data Objects), 543 sessions and, 430–436 PECL (PHP Extension Community Library), 354 tools, 29 percentages, 287 using in XML, 636–640 Perl, 22, 23, 38 variables, using, 310–317 Perl Compatible Regular Expressions (PCRE), 361 versions, 29 perror tool, 467 web pages, adding, 305–310 persistent attack, 379 PHP Data Objects (PDO), 543 persistent cookie, 421–422, 425–426, 431 PHP Extension Community Library (PECL), 354 persistent data, storing, 419–424 php file, 306, 307, 309, 341 Personal Home Page (PHP) See PHP PHP framework phone data field, 566 convention, 696–697 Phone Numbers table, 491 form validation, 700 phone property, 572 helper methods, 700 Photoshop, 183, 369 mobile devices, support for, 700–701 PHP (Personal Home Page), 29 overview, 695–696 behavior of, 350 routing, 699–700 benefits of, 303–304 scaffolding, 698–699 code for, 61, 305–306, 696 templates, 701 coding objects in, 573–579 files, including, 320–324 OOP basics of, 395–401 unit testing, 701–702 PHP libraries extensions, using, 349–354 functions classes, 409–418 date and time, 365–369 magic class methods, 401–409 image-handling, 369–374 overview, 395 math, 361–364 operators, using, 317–320 overview, 23, 303 text, 354–361 overview, 349–350 pages, 306–307 PHP packages, 36–37 program flow, controlling PHP server, 29–30, 36, 43 event-driven PHP, using, 339–348

Ngày đăng: 02/03/2019, 10:45

TỪ KHÓA LIÊN QUAN