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

Tài liệu HTML, XHTML and CSS All-In-One For Dummies, 2nd Edition docx

1,1K 5,9K 0
Tài liệu đã được kiểm tra trùng lặp

Đ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

Tiêu đề HTML, XHTML and CSS All-In-One For Dummies, 2nd Edition
Tác giả Andy Harris
Trường học Indiana University
Chuyên ngành Computer Science and Web Programming
Thể loại Sách hướng dẫn
Năm xuất bản 2009
Thành phố Indianapolis
Định dạng
Số trang 1.084
Dung lượng 18,43 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

• Client-Side Programming with JavaScript® • Server-Side Programming with PHP • Managing Data with MySQL® • Into the Future with AJAX • Moving from Pages to Sites Andy Harris Open the b

Trang 1

for videos, step-by-step examples,

how-to articles, or to shop!

• Client-Side Programming with JavaScript®

• Server-Side Programming with PHP

• Managing Data with MySQL®

• Into the Future with AJAX

• Moving from Pages to Sites

Andy Harris

Open the book and find:

• The basics of building XHTML documents

• What to do with selectors, classes, and styles

• How to build flexible layouts

• Tips on using HTML5

• Secrets of managing files and directories

• All about SQL coding

• AJAX essentials and how to add events with jQuery

• The advantages of a Content Management System

You too can become a

Web wizard! Here’s how to go

from simple pages to super sites

Contemplating your first dip into Web page creation, or

ready to take your sites to the next level? All you need are

these eight minibooks Newbies can start at the beginning

for a complete understanding of basic page creation with

HTML5, XHTML, and CSS If you’ve been there and done

that, jump ahead to managing data with MySQL, building

AJAX connections, and more!

• Lay the foundation — build the skeleton of your pages with

XHTML, use CSS to add color and formatting, and create dynamic

buttons or menus

• Serve it up — move to the server and use PHP to program

responses to Web requests or connect to databases

• Manage data — set up a secure data server and create a reliable

and trustworthy data back-end for your site

• Explore AJAX — learn the essentials of AJAX, how to add events

and animation, and cool ways to use the UI library

• Create super sites — understand clients and servers, work with

content management systems, and more

Andy Harris taught himself programming because it was fun Today he

teaches computer science, game development, and Web programming at

the university level; is a technology consultant for the state of Indiana; and

has helped people with disabilities to form their own Web development

companies

1 BOOKS

Valuable bonus programs on CD-ROM

Bonus CD Includes

Firefox browser plus valuable extensions and plugins

Aptana programmer’s editor that simplifies the process

XAMPP, an easy-to-install server package

Visit the companion Web site at www.dummies.com/

go/htmlxhtmlandcssaiofd2e for code and other

supporting materials

Valuable bonus tools on CD-ROM!

TML!

2nd Edition

2nd Edition

www.it-ebooks.info

Trang 2

Mobile Apps

There’s a Dummies App for This and That

With more than 200 million books in print and over 1,600 unique titles, Dummies is a global leader in how-to information Now you can get the same great Dummies information in an App With topics such as Wine, Spanish, Digital Photography, Certification, and more, you’ll have instant access to the topics you need to know in a format you can trust.

To get information on all our Dummies apps, visit the following:

www.Dummies.com/go/mobile from your computer.

www.Dummies.com/go/iphone/apps from your phone.

Start with FREE Cheat Sheets

Cheat Sheets include

• Common Instructions

• And Other Good Stuff!

Get Smart at Dummies.com

Dummies.com makes your life easier with 1,000s

of answers on everything from removing wallpaper

to using the latest version of Windows

Check out our

• Illustrated Articles

• Step-by-Step Instructions

Plus, each month you can win valuable prizes by entering

our Dummies.com sweepstakes *

Want a weekly dose of Dummies? Sign up for Newsletters on

• Digital Photography

• Microsoft Windows & Office

• Personal Finance & Investing

• Health & Wellness

• Computing, iPods & Cell Phones

• Food, Home & Garden

Find out “HOW” at Dummies.com

*Sweepstakes not currently available in all countries; visit Dummies.com for official rules.

To access the Cheat Sheet created specifically for this book, go to

www.dummies.com/cheatsheet/htmlxhtmlandcss

www.it-ebooks.info

Trang 4

www.it-ebooks.info

Trang 6

HTML, XHTML, & CSS All-in-One For Dummies ® , 2nd Edition

Copyright © 2011 by Wiley Publishing, Inc., Indianapolis, Indiana

Published by Wiley Publishing, Inc., Indianapolis, Indiana

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

permit-ted under Sections 107 or 108 of the 1976 Unipermit-ted States Copyright Act, without either the prior written

permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the

Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600

Requests to the Publisher for permission should be addressed to the Permission 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, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for the

Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, Making Everything

Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc and/or

its affi liates in the United States and other countries, and may not be used without written permission All

other trademarks are the property of their respective owners Wiley Publishing, 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

WITH-OUT 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

ORGANIZA-TION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITAORGANIZA-TION 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 www.wiley.com/techsupport.

Wiley also publishes its books in a variety of electronic formats Some content that appears in print may

not be available in electronic books.

Library of Congress Control Number: 2010937814

ISBN: 978-0-470-53755-8

Manufactured in the United States of America

10 9 8 7 6 5 4 3 2 1

Disclaimer: This eBook does not include ancillary media that was packaged with the

printed version of the book

www.it-ebooks.info

Trang 7

About the Author

Andy Harris began his teaching life as a special education teacher As he was

teaching young adults with severe disabilities, he taught himself enough puter programming to support his teaching habit with freelance program-ming Those were the exciting days when computers started to have hard drives, and some computers began communicating with each other over an arcane mechanism some were calling the Internet

com-All this time Andy was teaching computer science part time He joined the faculty of the Indiana University-Purdue University Indianapolis Computer Science department in 1995 He serves as a Senior Lecturer, teaching the introductory courses to freshmen as well as numerous courses on Web development, general programming, and game programming As manager

of the Streaming Media Laboratory, he developed a number of online based courses, and worked on a number of international distance education projects including helping to start a computer science program in Tetevo, Macedonia FYR

video-Andy is the author of several other computing books including JavaScript For

Dummies, Flash Game Programming For Dummies, and Game Programming:

the L Line He invites your comments and questions at andy@aharris

books.net You can visit his main site and fi nd a blog, forum, and links to other books at http://www.aharrisbooks.net

www.it-ebooks.info

Trang 8

www.it-ebooks.info

Trang 9

I dedicate this book to Jesus Christ, my personal savior, and to Heather, the joy in my life I also dedicate this project to Elizabeth, Matthew, Jacob, and Benjamin I love each of you

Author’s Acknowledgments

Thank you fi rst to Heather Even though I type all the words, this book is a real partnership, like the rest of our life Thanks for being my best friend and companion Thanks also for doing all the work it takes for us to sustain a family when I’m in writing mode

Thank you to Mark Enochs It’s great to have an editor who gets me, and who’s willing to get excited about a project I really enjoy working with you

Thanks very much to Katie Feltman It’s fun to see how far a few wacky ideas have gone Thanks for continuing to believe in me, and for helping me to always fi nd an interesting new project

Thank you to the copy editors: fi rst and foremost, I thank Brian Walls for his all his hard work in making this edition presentable Thanks also go to Teresa Artman, John Edwards, and Melba Hopper for their help I appreciate your efforts to make my geeky mush turn into something readable Thanks for improving my writing

A special thanks to Jeff Noble for his technical editing I appreciate your lance You have helped to make this book as technically accurate as possible

vigi-Thank you to the many people at Wiley who contribute to a project like this The author only gets to meet a few people, but so many more are involved in the process Thank you very much for all you’ve done to help make this project a reality

Thanks to Chris McCulloh for all you did on the fi rst edition, and I thank you for your continued friendship

A big thank you to the open source community which has created so many incredible tools and made them available to all I’d especially like to thank the creators of Firefox, Firebug, Aptana, HTML Validator, the Web Developer tool-bar, Ubuntu and the Linux community, Notepad++, PHP, Apache, jQuery, and the various jQuery plugins This is an amazing and generous community effort

I’d fi nally like to thank the IUPUI computer science family for years of support

on various projects Thank you especially to all my students, current and past I’ve learned far more from you than the small amount I’ve taught Thank you for letting me be a part of your education

www.it-ebooks.info

Trang 10

Publisher’s Acknowledgments

We’re proud of this book; please send us your comments through our online registration form

located at http://dummies.custhelp.com For other comments, 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.

Some of the people who helped bring this book to market include the following:

Acquisitions, Editorial, and Media

Development

Senior Project Editor: Mark Enochs

Senior Acquisitions Editor: Katie Feltman

Copy Editors: Brian Walls, Teresa Artman,

John Edwards, Melba Hopper

Technical Editor: Jeff Noble

Editorial Manager: Leah Cameron

Media Development Project Manager:

Laura Moss-Hollister

Media Development Assistant Project

Manager: Jenny Swisher Media Development Assistant Producer:

Shawn Patrick

Editorial Assistant: Amanda Graham

Sr Editorial Assistant: Cherie Case

Cartoons: Rich Tennant

Colleen Totz Diamond

Publishing and Editorial for Technology Dummies

Richard Swadley, Vice President and Executive Group Publisher Andy Cummings, Vice President and Publisher

Mary Bednarek, Executive Acquisitions Director Mary C Corder, Editorial Director

Publishing for Consumer Dummies

Diane Graves Steele, Vice President and Publisher Composition Services

Debbie Stailey, Director of Composition Services

www.it-ebooks.info

Trang 11

Contents at a Glance

Introduction 1

Book I: Creating the HTML/XHTML Foundation 7

Chapter 1: Sound HTML Foundations 9

Chapter 2: It’s All about Validation 19

Chapter 3: Choosing Your Tools 41

Chapter 4: Managing Information with Lists and Tables 65

Chapter 5: Making Connections with Links 83

Chapter 6: Adding Images 93

Chapter 7: Creating Forms 121

Chapter 8: The Future of HTML: HTML 5 141

Book II: Styling with CSS 157

Chapter 1: Coloring Your World 159

Chapter 2: Styling Text 177

Chapter 3: Selectors, Class, and Style 201

Chapter 4: Borders and Backgrounds 219

Chapter 5: Levels of CSS 239

Book III: Using Positional CSS 257

Chapter 1: Fun with the Fabulous Float 259

Chapter 2: Building Floating Page Layouts 279

Chapter 3: Styling Lists and Menus 299

Chapter 4: Using Alternative Positioning 317

Book IV: Client-Side Programming with JavaScript 335

Chapter 1: Getting Started with JavaScript 337

Chapter 2: Making Decisions with Conditions 359

Chapter 3: Loops and Debugging 373

Chapter 4: Functions, Arrays, and Objects 395

Chapter 5: Talking to the Page 423

Chapter 6: Getting Valid Input 445

Chapter 7: Animating Your Pages 467

www.it-ebooks.info

Trang 12

Book V: Server-Side Programming with PHP 499

Chapter 1: Getting Started on the Server 501

Chapter 2: PHP and XHTML Forms 519

Chapter 3: Control Structures 539

Chapter 4: Working with Arrays 559

Chapter 5: Using Functions and Session Variables 579

Chapter 6: Working with Files and Directories 591

Chapter 7: Connecting to a MySQL Database 613

Book VI: Managing Data with MySQL 635

Chapter 1: Getting Started with Data 637

Chapter 2: Managing Data with SQL 665

Chapter 3: Normalizing Your Data 691

Chapter 4: Putting Data Together with Joins 705

Book VII: Into the Future with AJAX 729

Chapter 1: AJAX Essentials 731

Chapter 2: Improving JavaScript and AJAX with jQuery 747

Chapter 3: Animating jQuery 771

Chapter 4: Using the jQuery User Interface Toolkit 797

Chapter 5: Improving Usability with jQuery 823

Chapter 6: Working with AJAX Data 843

Book VIII: Moving from Pages to Sites 867

Chapter 1: Managing Your Servers 869

Chapter 2: Planning Your Sites 895

Chapter 3: Introducing Content Management Systems 915

Chapter 4: Editing Graphics 941

Chapter 5: Taking Control of Content 961

Appendix A: What’s on the CD 979

Index 985

www.it-ebooks.info

Trang 13

Table of Contents

Introduction 1

No Experience Necessary 2

Great for Advanced Folks, Too! 2

Use Any Computer 3

Don’t Buy Any Software 3

How This Book Is Organized 4

New for the Second Edition 5

Icons Used in This Book 6

What’s Next? 6

Book I: Creating the HTML/XHTML Foundation 7

Chapter 1: Sound HTML Foundations 9

Creating a Basic Page 9

Understanding the HTML in the Basic Page 11

Meeting Your New Friends, the Tags 12

Setting Up Your System 15

Displaying fi le extensions 15

Setting up your software 16

Chapter 2: It’s All about Validation 19

Somebody Stop the HTML Madness! 19

XHTML to the rescue 20

There’s XHTML and there’s good XHTML 21

Building an XHTML Document 22

Don’t memorize all this! 22

The DOCTYPE tag 22

The xmlns attribute 23

The meta tag 23

You validate me 23

Validating Your Page 25

Aesop visits W3C 27

Showing off your mad skillz 35

Using Tidy to repair pages 37

www.it-ebooks.info

Trang 14

HTML, XHTML, & CSS All-in-One For Dummies, 2nd Edition

xii

Chapter 3: Choosing Your Tools .41

What’s Wrong with the Big Boys? 41

Alternative Web Development Tools 43

The features you need on your computer 43

Building a basic toolbox 43

Picking a Text Editor 44

Tools to avoid unless you have nothing else 44

A noteworthy editor: Notepad++ 45

The old standards: VI and Emacs 46

Other text editors 49

The Web Developer’s Browser 49

A little ancient history 49

Overview of the prominent browsers 50

Other notable browsers 52

The bottom line in browsers 53

Tricking Out Firefox 53

Validating your pages with HTML Validator 54

Using the Web Developer toolbar 55

Using Firebug 57

Using a Full-Blown IDE 58

Introducing Aptana 58

Customizing Aptana 60

Introducing Komodo Edit 62

Chapter 4: Managing Information with Lists and Tables 65

Making a List and Checking It Twice 65

Creating an unordered list 65

Creating ordered lists 67

Making nested lists 69

Building the defi nition list 72

Building Tables 74

Defi ning the table 75

Spanning rows and columns 77

Avoiding the table-based layout trap 80

Chapter 5: Making Connections with Links 83

Making Your Text Hyper 83

Introducing the anchor tag 84

Comparing block-level and inline elements 85

Analyzing an anchor 86

Introducing URLs 86

Making Lists of Links 88

Working with Absolute and Relative References 89

Understanding absolute references 89

Introducing relative references 89

www.it-ebooks.info

Trang 15

Table of Contents xiii

Chapter 6: Adding Images 93

Adding Images to Your Pages 93

Adding links to images 94

Adding inline images using the <img> tag 96

Choosing an Image Manipulation Tool 98

An image is worth 3.4 million words! 98

Introducing IrfanView 101

Choosing an Image Format 102

BMP 102

JPG/JPEG 102

GIF 103

PNG 105

Summary of Web image formats 106

Manipulating Your Images 106

Changing formats in IrfanView 106

Resizing your images 108

Enhancing image colors 109

Using built-in effects 110

Other effects you can use 115

Batch processing 115

Using Images as Links 117

Creating thumbnail images 118

Creating a thumbnail-based image directory 120

Chapter 7: Creating Forms .121

You Have Great Form 121

Forms must have some form 123

Organizing a form with fi eldsets and labels 123

Building Text-Style Inputs 126

Making a standard text fi eld 126

Building a password fi eld 127

Making multi-line text input 128

Creating Multiple Selection Elements 130

Making selections 130

Building check boxes 132

Creating radio buttons 134

Pressing Your Buttons 136

Making input-style buttons 137

Building a Submit button 138

It’s a do-over: The Reset button 138

Introducing the <button> tag 139

Chapter 8: The Future of HTML: HTML 5 .141

Can’t We Just Stick with XHTML? 141

Using the HTML 5 doctype 142

Browser support for HTML 5 142

Validating HTML 5 142

www.it-ebooks.info

Trang 16

HTML, XHTML, & CSS All-in-One For Dummies, 2nd Edition

xiv

Semantic Elements 142

Using New Form Elements 144

Using Embedded Fonts 147

Audio and Video Tags 149

The Canvas Tag 152

Other Promising Features 155

Limitations of HTML 5 156

Book II: Styling with CSS 157

Chapter 1: Coloring Your World .159

Now You Have an Element of Style 159

Setting up a style sheet 161

Changing the colors 162

Specifying Colors in CSS 163

Using color names 163

Putting a hex on your colors 164

Coloring by number 165

Hex education 165

Using the Web-safe color palette 167

Choosing Your Colors 168

Starting with Web-safe colors 169

Modifying your colors 169

Doing it on your own pages 170

Changing CSS on the fl y 170

Creating Your Own Color Scheme 172

Understanding hue, saturation, and value 172

Using the Color Scheme Designer 173

Selecting a base hue 174

Picking a color scheme 175

Chapter 2: Styling Text 177

Setting the Font Family 177

Applying the font-family style attribute 179

Using generic fonts 180

Making a list of fonts 181

The Curse of Web-Based Fonts 183

Understanding the problem 183

Examining possible solutions 184

Using images for headlines 185

Specifying the Font Size 188

Size is only a suggestion! 188

Using the font-size style attribute 188

Absolute measurement units 189

Relative measurement units 190

www.it-ebooks.info

Trang 17

Table of Contents xv

Determining Other Font Characteristics 191

Using font-style for italics 192

Using font-weight for bold 193

Using text-decoration 194

Using text-align for basic alignment 196

Other text attributes 197

Using the font shortcut 197

Working with subscripts and superscripts 199

Chapter 3: Selectors, Class, and Style 201

Selecting Particular Segments 201

Defi ning more than one kind of paragraph 201

Styling identifi ed paragraphs 203

Using Emphasis and Strong Emphasis 203

Adding emphasis to the page 204

Modifying the display of em and strong 204

Defi ning Classes 206

Adding classes to the page 207

Combining classes 208

Introducing div and span 210

Organizing the page by meaning 211

Why not make a table? 212

Using Pseudo-Classes to Style Links 213

Styling a standard link 213

Styling the link states 213

Best link practices 215

Selecting in Context 216

Defi ning Multiple Styles at Once 217

Chapter 4: Borders and Backgrounds .219

Joining the Border Patrol 219

Using the border attributes 219

Defi ning border styles 221

Using the border shortcut 222

Creating partial borders 222

Introducing the Box Model 224

Borders, margin, and padding 224

Positioning elements with margins and padding 226

Changing the Background Image 228

Getting a background check 230

Solutions to the background conundrum 230

Manipulating Background Images 234

Turning off the repeat 234

Making effective gradients with repeat-x and repeat-y 235

Using Images in Lists 237

www.it-ebooks.info

Trang 18

HTML, XHTML, & CSS All-in-One For Dummies, 2nd Edition

xvi

Chapter 5: Levels of CSS 239

Managing Levels of Style 239

Using local styles 239

Using an external style sheet 242

Understanding the Cascading Part of Cascading Style Sheets 246

Inheriting styles 247

Hierarchy of styles 248

Overriding styles 249

Precedence of style defi nitions 250

Using Conditional Comments 251

Coping with incompatibility 251

Making Internet Explorer–specifi c code 252

Using a conditional comment with CSS 253

Checking the Internet Explorer version 256

Book III: Using Positional CSS 257

Chapter 1: Fun with the Fabulous Float 259

Avoiding Old-School Layout Pitfalls 259

Problems with frames 259

Problems with tables 260

Problems with huge images 261

Problems with Flash 261

Introducing the Floating Layout Mechanism 262

Using fl oat with images 263

Adding the fl oat property 264

Using Float with Block-Level Elements 265

Floating a paragraph 265

Adjusting the width 267

Setting the next margin 268

Using Float to Style Forms 270

Using fl oat to beautify the form 272

Adjusting the fi eldset width 275

Using the clear attribute to control page layout 276

Chapter 2: Building Floating Page Layouts 279

Creating a Basic Two-Column Design 279

Designing the page 279

Building the XHTML 281

Adding preliminary CSS 282

Using temporary borders 283

Setting up the fl oating columns 285

Tuning up the borders 285

Advantages of a fl uid layout 287

www.it-ebooks.info

Trang 19

Table of Contents xvii

Building a Three-Column Design 287

Styling the three-column page 289

Problems with the fl oating layout 290

Specifying a min-height 291

Building a Fixed-Width Layout 293

Setting up the XHTML 293

Using an image to simulate true columns 294

Building a Centered Fixed-Width Layout 295

Making a surrogate body with an all div 296

How the jello layout works 298

Limitations of the jello layout 298

Chapter 3: Styling Lists and Menus .299

Revisiting List Styles 299

Defi ning navigation as a list of links 300

Turning links into buttons 300

Building horizontal lists 302

Creating Dynamic Lists 304

Building a nested list 304

Hiding the inner lists 306

Getting the inner lists to appear on cue 307

Building a Basic Menu System 310

Building a vertical menu with CSS 312

Building a horizontal menu 314

Chapter 4: Using Alternative Positioning .317

Working with Absolute Positioning 317

Setting up the HTML 318

Adding position guidelines 318

Making absolute positioning work 319

Managing z-index 320

Handling depth 320

Working with z-index 322

Building a Page Layout with Absolute Positioning 322

Overview of absolute layout 322

Writing the XHTML 324

Adding the CSS 324

Creating a More Flexible Layout 326

Designing with percentages 326

Building the layout 328

Exploring Other Types of Positioning 329

Creating a fi xed menu system 330

Setting up the XHTML 331

Setting the CSS values 332

Determining Your Layout Scheme 334

www.it-ebooks.info

Trang 20

HTML, XHTML, & CSS All-in-One For Dummies, 2nd Edition

xviii

Book IV: Client-Side Programming with JavaScript 335

Chapter 1: Getting Started with JavaScript .337

Working in JavaScript 337

Choosing a JavaScript editor 338

Picking your test browser 339

Writing Your First JavaScript Program 340

Embedding your JavaScript code 341

Creating comments 342

Using the alert( ) method for output 342

Adding the semicolon 342

Introducing Variables 342

Creating a variable for data storage 344

Asking the user for information 344

Responding to the user 345

Using Concatenation to Build Better Greetings 345

Comparing literals and variables 347

Including spaces in your concatenated phrases 347

Understanding the String Object 347

Introducing object-based programming (and cows) 348

Investigating the length of a string 348

Using string methods to manipulate text 349

Understanding Variable Types 352

Adding numbers 352

Adding the user’s numbers 353

The trouble with dynamic data 354

The pesky plus sign 355

Changing Variables to the Desired Type 356

Using variable conversion tools 356

Fixing the addInput code 357

Chapter 2: Making Decisions with Conditions 359

Working with Random Numbers 359

Creating an integer within a range 359

Building a program that rolls dice 360

Using if to Control Flow 361

The basic if statement 362

All about conditions 363

Comparison operators 363

Using the else Clause 364

Using if-else for more complex interaction 365

Solving the mystery of the unnecessary else 367

Using switch for More Complex Branches 367

Creating an expression 368

Switching with style 369

www.it-ebooks.info

Trang 21

Table of Contents xix

Nesting if Statements 370

Building the nested conditions 371

Making sense of nested ifs 372

Chapter 3: Loops and Debugging .373

Building Counting Loops with for 373

Building a standard for loop 374

Counting backward 375

Counting by 5 375

Looping for a while 377

Creating a basic while loop 377

Avoiding loop mistakes 378

Introducing Bad Loops 378

Managing the reluctant loop 379

Managing the obsessive loop 379

Debugging Your Code 380

Letting Aptana help 380

Debugging JavaScript on Internet Explorer 381

Finding errors in Firefox 383

Finding errors with Firebug 383

Catching Logic Errors 384

Logging to the console with Firebug 385

Looking at console output 386

Using the Interactive Debug Mode 387

Setting up the Firebug debugger 388

Setting a breakpoint 389

Adding a debugger directive 389

Examining debug mode 390

Debugging your code 392

Chapter 4: Functions, Arrays, and Objects .395

Breaking Code into Functions 395

Thinking about structure 396

Building the antsFunction.html program 397

Passing Data to and from Functions 398

Examining the main code 399

Looking at the chorus 400

Handling the verses 400

Managing Scope 402

Introducing local and global variables 402

Examining variable scope 402

Building a Basic Array 405

Accessing array data 405

Using arrays with for loops 406

Revisiting the ants song 407

www.it-ebooks.info

Trang 22

HTML, XHTML, & CSS All-in-One For Dummies, 2nd Edition

xx

Working with Two-Dimension Arrays 409Setting up the arrays 410Getting a city 411Creating a main( ) function 411Creating Your Own Objects 413Building a basic object 413Adding methods to an object 414Building a reusable object 415Using your shiny new objects 417Introducing JSON 417Storing data in JSON format 418Building a more complex JSON structure 419

Chapter 5: Talking to the Page .423

Understanding the Document Object Model 423Navigating the DOM 423Changing DOM properties with Firebug 425Examining the document object 425Harnessing the DOM through JavaScript 427Getting the blues, JavaScript-style 427Writing JavaScript code to change colors 428Managing Button Events 428Embedding quotes within quotes 431Writing the changeColor function 431Managing Text Input and Output 432Introducing event-driven programming 432Creating the XHTML form 433Using GetElementById to get access to the page 434Manipulating the text fi elds 435Writing to the Document 436Preparing the HTML framework 436Writing the JavaScript 437

Finding your innerHTML 438

Working with Other Text Elements 438Building the form 440Writing the function 441Understanding generated source 442

Chapter 6: Getting Valid Input 445

Getting Input from a Drop-Down List 445Building the form 446Reading the list box 447Managing Multiple Selections 448Coding a multiple selection select object 449Writing the JavaScript code 450

www.it-ebooks.info

Trang 23

Table of Contents xxi

Check, Please: Reading Check Boxes 452Building the check box page 452Responding to the check boxes 453Working with Radio Buttons 454Interpreting radio buttons 456Working with Regular Expressions 457Introducing regular expressions 460Using characters in regular expressions 462Marking the beginning and end of the line 463Working with special characters 463Conducting repetition operations 464Working with pattern memory 465

Chapter 7: Animating Your Pages 467

Making Things Move 467Looking over the HTML 468Getting an overview of the JavaScript 470Creating global variables 471Initializing 472Moving the sprite 472Checking the boundaries 474Reading Input from the Keyboard 475Building the keyboard page 476Overwriting the init( ) function 477Setting up an event handler 478Responding to keystrokes 479Deciphering the mystery of key codes 480Following the Mouse 481Looking over the HTML 481Initializing the code 482Building the mouse listener 483Creating Automatic Motion 483Creating a setInterval( ) call 485Building Image-Swapping Animation 486Preparing the images 487Building the page 487Building the global variables 488Setting up the interval 489Animating the sprite 489Preloading Your Images 490Movement and swapping 492Building the code 494Defi ning global variables 495Initializing your data 496Preloading the images 496Animating and updating the image 497Moving the sprite 497

www.it-ebooks.info

Trang 24

HTML, XHTML, & CSS All-in-One For Dummies, 2nd Edition

xxii

Book V: Server-Side Programming with PHP 499

Chapter 1: Getting Started on the Server 501

Introducing Server-Side Programming 501Programming on the server 501Serving your programs 502Picking a language 503Installing Your Web Server 504Inspecting phpinfo( ) 505Building XHTML with PHP 508Coding with Quotation Marks 510Working with Variables PHP-Style 511Concatenation 512Interpolating variables into text 513Building XHTML Output 514Using double quote interpolation 515Generating output with heredocs 515Switching from PHP to XHTML 517

Chapter 2: PHP and XHTML Forms 519

Exploring the Relationship between PHP and XHTML 519Embedding PHP inside XHTML 520Viewing the results 521Sending Data to a PHP Program 522Creating a form for PHP processing 523Receiving data in PHP 525Choosing the Method of Your Madness 527Using get to send data 527Using the post method to transmit form data 529Getting data from the form 530Retrieving Data from Other Form Elements 532Building a form with complex elements 532Responding to a complex form 535

Chapter 3: Control Structures .539

Introducing Conditions (Again) 539Building the Classic if Statement 540Rolling dice the PHP way 541Checking your six 541Understanding comparison operators 545Taking the middle road 545Building a program that makes its own form 547Making a switch 549Looping with for 552Looping with while 555

www.it-ebooks.info

Trang 25

Table of Contents xxiii

Chapter 4: Working with Arrays 559

Using One-Dimensional Arrays 559Creating an array 559Filling an array 560Viewing the elements of an array 560Preloading an array 562Using Loops with Arrays 562Simplifying loops with foreach 564Arrays and HTML 565Introducing Associative Arrays 567Using foreach with associative arrays 568Introducing Multidimensional Arrays 570We’re going on a trip 570Looking up the distance 572Breaking a String into an Array 574Creating arrays with explode 574Creating arrays with preg_split 576

Chapter 5: Using Functions and Session Variables 579

Creating Your Own Functions 579Rolling dice the old-fashioned way 579Improving code with functions 582Managing variable scope 583Returning data from functions 585Managing Persistence with Session Variables 586Understanding session variables 587Adding session variables to your code 589

Chapter 6: Working with Files and Directories 591

Text File Manipulation 591Writing text to fi les 592Writing a basic text fi le 594Reading from the fi le 599Using Delimited Data 601Storing data in a CSV fi le 601Viewing CSV data directly 603Reading the CSV data in PHP 604Working with File and Directory Functions 608opendir( ) 608readdir( ) 608chdir( ) 609Generating the list of fi le links 609

Chapter 7: Connecting to a MySQL Database 613

Retrieving Data from a Database 613Understanding data connections 616Building a connection 617

www.it-ebooks.info

Trang 26

HTML, XHTML, & CSS All-in-One For Dummies, 2nd Edition

xxiv

Passing a query to the database 618Processing the results 619Extracting the rows 620Extracting fi elds from a row 621Printing the data 622Improving the Output Format 623Building defi nition lists 623Using XHTML tables for output 625Allowing User Interaction 628Building an XHTML search form 629Responding to the search request 630Breaking the code into functions 631Processing the input 632Generating the output 633

Book VI: Managing Data with MySQL 635

Chapter 1: Getting Started with Data 637

Examining the Basic Structure of Data 637Determining the fi elds in a record 639Introducing SQL data types 639Specifying the length of a record 640Defi ning a primary key 641Defi ning the table structure 642Introducing MySQL 643Why use MySQL? 643Understanding the three-tier architecture 644Practicing with MySQL 645Setting Up phpMyAdmin 646Changing the root password 648Adding a user 653Using phpMyAdmin on a remote server 656Making a Database with phpMyAdmin 659

Chapter 2: Managing Data with SQL .665

Writing SQL Code by Hand 665Understanding SQL syntax rules 666Examining the buildContact.sql script 666Dropping a table 667Creating a table 667Adding records to the table 668Viewing the sample data 669Running a Script with phpMyAdmin 669Using AUTO_INCREMENT for Primary Keys 672Selecting Data from Your Tables 674Selecting only a few fi elds 675Selecting a subset of records 677

www.it-ebooks.info

Trang 27

Table of Contents xxv

Searching with partial information 679Searching for the ending value of a fi eld 680Searching for any text in a fi eld 681Searching with regular expressions 681Sorting your responses 682Editing Records 684Updating a record 684Deleting a record 684Exporting Your Data and Structure 685Exporting SQL code 688Creating XML data 690

Chapter 3: Normalizing Your Data .691

Recognizing Problems with Single-Table Data 691The identity crisis 692The listed powers 692Repetition and reliability 694Fields that change 695Deletion problems 695Introducing Entity-Relationship Diagrams 695Using MySQL Workbench to draw ER diagrams 696Creating a table defi nition in Workbench 696Introducing Normalization 700First normal form 700Second normal form 701Third normal form 702Identifying Relationships in Your Data 703

Chapter 4: Putting Data Together with Joins 705

Calculating Virtual Fields 705Introducing SQL Functions 706Knowing when to calculate virtual fi elds 707Calculating Date Values 707Using DATEDIFF to determine age 708Adding a calculation to get years 709Converting the days integer into a date 710Using YEAR( ) and MONTH( ) to get readable values 711Concatenating to make one fi eld 712Creating a View 713Using an Inner Join to Combine Tables 715Building a Cartesian join and an inner join 717Enforcing one-to-many relationships 719Counting the advantages of inner joins 720Building a view to encapsulate the join 721Managing Many-to-Many Joins 721Understanding link tables 723Using link tables to make many-to-many joins 724

www.it-ebooks.info

Trang 28

HTML, XHTML, & CSS All-in-One For Dummies, 2nd Edition

xxvi

Book VII: Into the Future with AJAX 729

Chapter 1: AJAX Essentials 731

AJAX Spelled Out 733

A is for asynchronous 733

J is for JavaScript 733

A is for and? 734And X is for data 734Making a Basic AJAX Connection 734Building the HTML form 737Creating an XMLHttpRequest object 738Opening a connection to the server 739Sending the request and parameters 740Checking the status 740All Together Now — Making the Connection Asynchronous 741Setting up the program 743Building the getAJAX( ) function 743Reading the response 745

Chapter 2: Improving JavaScript and AJAX with jQuery 747

Introducing jQuery 749Installing jQuery 750Importing jQuery from Google 750Your First jQuery App 751Setting up the page 752Meet the jQuery node object 753Creating an Initialization Function 754Using $(document).ready( ) 755Alternatives to document.ready 756Investigating the jQuery Object 757Changing the style of an element 757Selecting jQuery objects 759Modifying the style 759Adding Events to Objects 760Adding a hover event 760Changing classes on the fl y 762Making an AJAX Request with jQuery 764Including a text fi le with AJAX 765Building a poor man’s CMS with AJAX 766

Chapter 3: Animating jQuery 771

Playing Hide and Seek 771Getting transition support 773Writing the HTML and CSS foundation 775

www.it-ebooks.info

Trang 29

Table of Contents xxvii

Initializing the page 776Hiding and showing the content 777Toggling visibility 778Sliding an element 778Fading an element in and out 779Changing Position with jQuery 779Creating the framework 782Setting up the events 782Don’t go chaining okay, do it all you want 783Building the move( ) function with chaining 784Building time-based animation with animate( ) 785Move a little bit: Relative motion 785Modifying Elements on the Fly 786Building the basic page 791Initializing the code 792Adding text 792Attack of the clones 793It’s a wrap 794Alternating styles 795Resetting the page 795More fun with selectors and fi lters 796

Chapter 4: Using the jQuery User Interface Toolkit 797

What the jQuery User Interface Brings to the Table 797It’s a theme park 798Using the themeRoller to get an overview of jQuery 798Wanna drag? Making components draggable 802Downloading the library 803Writing the program 805Resizing on a Theme 805Examining the HTML and standard CSS 809Importing the fi les 809Making a resizable element 809Adding themes to your elements 810Adding an icon 812Dragging, Dropping, and Calling Back 814Building the basic page 816Initializing the page 817Handling the drop 818Beauty school dropout events 819Cloning the elements 819

Chapter 5: Improving Usability with jQuery 823

Multi-element Designs 823Playing the accordion widget 824Building a tabbed interface 827Using tabs with AJAX 830

www.it-ebooks.info

Trang 30

HTML, XHTML, & CSS All-in-One For Dummies, 2nd Edition

xxviii

Improving Usability 833Playing the dating game 834Picking numbers with the slider 836Selectable elements 838Building a sortable list 839Creating a custom dialog box 840

Chapter 6: Working with AJAX Data 843

Sending Requests AJAX Style 843Sending the data 844Simplifying PHP for AJAX 846Building a Multipass Application 847Setting up the HTML framework 849Loading the select element 850Writing the loadList.php program 851Responding to selections 852Writing the showHero.php script 853Working with XML Data 854Review of XML 855Manipulating XML with jQuery 856Creating the HTML 858Retrieving the data 858Processing the results 859Printing the pet name 859Working with JSON Data 860Knowing JSON’s pros 860Reading JSON data with jQuery 862Managing the framework 864Retrieving the JSON data 864Processing the results 865

Book VIII: Moving from Pages to Sites 867

Chapter 1: Managing Your Servers 869

Understanding Clients and Servers 869Parts of a client-side development system 870Parts of a server-side system 871Creating Your Own Server with XAMPP 872Running XAMPP 873Testing your XAMPP confi guration 874Adding your own fi les 874Setting the security level 876Compromising between functionality and security 877Choosing a Web Host 878Finding a hosting service 879Connecting to a hosting service 880

www.it-ebooks.info

Trang 31

Table of Contents xxix

Managing a Remote Site 881Using Web-based fi le tools 881Understanding fi le permissions 884Using FTP to manage your site 884Naming Your Site 887Understanding domain names 887Registering a domain name 888Managing Data Remotely 891Creating your database 892Finding the MySQL server name 893

Chapter 2: Planning Your Sites 895

Creating a Multipage Web Site 895Planning a Larger Site 896Understanding the Client 896Ensuring that the client’s expectations are clear 897Delineating the tasks 898Understanding the Audience 899Determining whom you want to reach 899Finding out the user’s technical expertise 900Building a Site Plan 901Creating a site overview 902Building the site diagram 903Creating Page Templates 905Sketching the page design 905Building the XHTML template framework 907Creating page styles 909Building a data framework 912Fleshing Out the Project 913Making the site live 913Contemplating effi ciency 914

Chapter 3: Introducing Content Management Systems .915

Overview of Content Management Systems 916Previewing Common CMSs 917Moodle 917WordPress 918Drupal 919Building a CMS site with Website Baker 920Installing your CMS 921Getting an overview of Website Baker 925Adding your content 925Using the WYSIWYG editor 927Changing the template 931Adding additional templates 932Adding new functionality 934

www.it-ebooks.info

Trang 32

HTML, XHTML, & CSS All-in-One For Dummies, 2nd Edition

xxx

Building Custom Themes 935Starting with a prebuilt template 935Changing the info.php fi le 937Modifying index.php 938Modifying the CSS fi les 939Packaging your template 940

Chapter 4: Editing Graphics 941

Using a Graphic Editor 941Choosing an editor 942Introducing Gimp 942Creating an image 944Painting tools 945Selection tools 947Modifi cation tools 949Managing tool options 950Utilities 950Understanding Layers 952Introducing Filters 954Solving Common Web Graphics Problems 954Changing a color 955Building a banner graphic 956Building a tiled background 958

Chapter 5: Taking Control of Content 961

Building a “Poor Man’s CMS” with Your Own Code 961Using Server-Side Includes (SSIs) 961Using AJAX and jQuery for client-side inclusion 964Building a page with PHP includes 966Creating Your Own Data-Based CMS 967Using a database to manage content 967Writing a PHP page to read from the table 970Allowing user-generated content 973Adding a new block 976Improving the dbCMS design 978

Appendix A: What’s on the CD 979

System Requirements 979Using the CD 980What You’ll Find on the CD 980Author-created material 981Aptana Studio 2.0 981Dia 0.97.1 981FileZilla 3.3.1 981Firefox 3.6 and Extensions 981

www.it-ebooks.info

Trang 33

Table of Contents xxxi

GIMP 2.6 982HTML Tidy 982IrfanView 4.25 982IZArc 4.1 982jEdit 982jQuery 1.4 982Komodo Edit 983KompoZer 0.7.10 983Notepad++ 983SQLite 3.6.22 983WebsiteBaker 2.8.1 983XAMPP 1.7.3 983XnView 1.97 983Troubleshooting 984

Index 985

www.it-ebooks.info

Trang 34

HTML, XHTML, & CSS All-in-One For Dummies, 2nd Edition

xxxii

www.it-ebooks.info

Trang 35

I love the Internet, and if you picked up this book, you probably do, too

The Internet is dynamic, chaotic, exciting, interesting, and useful, all at the same time The Web is pretty fun from a user’s point of view, but that’s only part of the story Perhaps the best part of the Internet is how partici-patory it is You can build your own content — free! It’s really amazing

There’s never been a form of communication like this before Anyone with access to a minimal PC and a little bit of knowledge can create his or her own homestead in one of the most exciting platforms in the history of com-munication

The real question is how to get there A lot of Web development books are really about how to use some sort of software you have to buy That’s okay, but it isn’t necessary Many software packages have evolved that purport to make Web development easier — and some work pretty well — but regard-less what software package you use, there’s still a need to know what’s really going on under the surface That’s where this book comes in

You’ll find out exactly how the Web works in this book You’ll figure out how to use various tools, but, more importantly, you’ll create your piece of the Web You’ll discover:

How Web pages are created: You’ll figure out the basic structure of

Web pages You’ll understand the structure well because you build pages yourself No mysteries here

How to separate content and style: You’ll understand the foundation

of modern thinking about the Internet — that style should be separate from content

How to use Web standards: The Web is pretty messy, but, finally, some

standards have arisen from the confusion You’ll discover how these standards work and how you can use them

How to create great-looking Web pages: Of course, you want a

terrific-looking Web site With this book, you’ll find out how to use layout, style, color, and images

How to build modern layouts: Many Web pages feature columns,

menus, and other fancy features You’ll figure out how to build all these things

How to add interactivity: Adding forms to your pages, validating

form data, and creating animations are all possible with the JavaScript language

www.it-ebooks.info

Trang 36

2 No Experience Necessary

How to write programs on the server: Today’s Web is powered by

pro-grams on Web servers You’ll discover the powerful PHP language and figure out how to use it to create powerful and effective sites

How to harness the power of data: Every Web developer eventually

needs to interact with data You’ll read about how to create databases that work You’ll also discover how to connect databases to your Web pages and how to create effective and useful interfaces

How AJAX is changing everything: The hottest Web technology on the

horizon is AJAX (Asynchronous JavaScript and XML) You’ll figure out how to harness this way of working and use it to create even more pow-erful and interesting applications

No Experience Necessary

I’m not assuming anything in this book If you’ve never built a Web page before, you’re in the right hands You don’t need any experience, and you don’t have to know anything about HTML, programming, or databases I dis-cuss everything you need

If you’re reasonably comfortable with a computer (you can navigate the Web and use a word processor), you have all the skills you need

Great for Advanced Folks, Too!

If you’ve been around Web development for a while, you’ll still find this book handy

If you’ve used HTML but not XHTML, see how things have changed and cover the powerful combination of XHTML and CSS

dis-If you’re still using table-based layouts, you’ll definitely want to read about newer ways of thinking After you get over the difference, you’ll be amazed at the power, the flexibility, and the simplicity of CSS-based layout and design

If you’re already comfortable with XHTML and CSS, you’re ready to add JavaScript functionality for form validation and animation If you’ve never used a programming language before, JavaScript is a really great place

www.it-ebooks.info

Trang 37

Don’t Buy Any Software

If you’re messing with commercial development, you’ll definitely need to know more about databases I get e-mails every week from companies look-ing for people who can create a solid relational database and connect it to a Web site with PHP

If you’re curious about AJAX, you can read about what it is, how it works, and how to use it to add functionality to your site You’ll also read about a very powerful and easy AJAX library that can add tremendous functionality

to your bag of tricks

I wrote this book as the reference I wish I had If you have only one Web development book on your shelf, this should be the one Wherever you are

in your Web development journey, you can find something interesting and new in this book

Use Any Computer

One of the great things about Web development is how accessible it can

be You don’t need a high-end machine to build Web sites Whatever you’re using now will probably do fine I built most of the examples in this book with Windows XP and Ubuntu Linux, but a Mac is perfectly fine, too Most of the software I use in the book is available free for all major platforms Similar alternatives for all platforms are available in the few cases when this isn’t true

Don’t Buy Any Software

Everything you need for Web development is on the CD-ROM I’ve used only open-source software for this book The CD contains a ton of tools and help-ful programs See Appendix A in the back of this book for a complete listing

Following are the highlights:

Aptana: A full-featured programmer’s editor that greatly simplifies

creat-ing Web pages, CSS documents, and code in multiple languages

Firefox extensions: I’ve included several extensions to the Firefox Web

browser that turn it into a thoroughbred Web development platform

The Web Developer toolbar adds all kinds of features for creating and testing pages; the HTML Validator checks your pages for standards compliance; and the Firebug extension adds incredible features for JavaScript and AJAX debugging

XAMPP: When you’re ready to move to the server, XAMPP is a

com-plete server package that’s easy to install and incredibly powerful This includes the incredible Apache Web server, the PHP programming lan-guage, the MySQL database manager, and tons of useful utilities

www.it-ebooks.info

Trang 38

4 How This Book Is Organized

Useful tools: Every time I use a tool (such as a data mapper, a diagram

tool, or an image editor) in this book, I make it available on the CD-ROM

There’s no need to buy any expensive Web development tools Everything you need is here and no harder than the more expensive Web editors

How This Book Is Organized

Web development is about solving a series of connected but different lems This book is organized into eight minibooks based on specific technol-ogies You can read them in any order you wish, but you’ll find that the later books tend to rely on topics described in the earlier books (For example, JavaScript doesn’t make much sense without XHTML because it’s usually embedded in a Web page.) The following describes these eight minibooks:

Book I: Creating the HTML/XHTML Foundation — Web development

incorporates a lot of languages and technologies, but HTML is the

foun-dation Here I show you XHTML, the latest incarnation of HTML, and

describe how it’s used to form the basic skeleton of your pages I also preview the upcoming HTML 5 standard

Book II: Styling with CSS — In the old days, HTML had a few tags to

spruce up your pages, but they weren’t nearly powerful enough Today, developers use Cascading Style Sheets (CSS) to add color and formatting

to your pages

Book III: Using Positional CSS — Discover the best ways to set up

lay-outs with floating elements, fixed positioning, and absolute positioning

Figure out how to build various multicolumn page layouts and how to create dynamic buttons and menus

Book IV: Client-Side Programming with JavaScript — Figure out

essen-tial programming skills with the easy and powerful JavaScript language — even if you’ve never programmed before Manipulate data in Web forms and use powerful regular expression technology to validate form entries

Also discover how to create animations with JavaScript

Book V: Server-Side Programming with PHP — Move your code to the

server and take advantage of this powerful language Figure out how to respond to Web requests; work with conditions, functions, objects, and text files; and connect to databases

Book VI: Managing Data with MySQL — Most serious Web projects are

eventually about data Figure out how databases are created, how to set

up a secure data server, the basics of data normalization, and how to create a reliable and trustworthy data back end for your site

www.it-ebooks.info

Trang 39

New for the Second Edition

Book VII: Into the Future with AJAX — Look forward to the technology

that has the Web abuzz AJAX isn’t really a language but rather a new way of thinking about Web development Get the skinny on what’s going

on here, build an AJAX connection or two by hand, and use the really cool jQuery library for adding advanced features and functionality to your pages

Book VIII: Moving from Pages to Sites — This minibook ties together

many of the threads throughout the rest of the book Discover how to create your own complete Web server solution or pick a Web host Walk through the process of designing a complex multipage Web site Build graphics for your Web site Discover how to use content management systems to simplify complex Web sites and, finally, to build your own content management system with skills taught throughout the book

New for the Second Edition

This second edition keeps the organization and content of the first edition I have made a few changes to keep up with advances in technology:

Preview of HTML 5: HTML 5 and CSS 3 offer promising new features

While it may be too early to incorporate these features into every page, it’s time to learn what’s coming Book I, Chapter 8 highlights these wel-come new advances

Improved PHP coverage: I greatly enhanced and streamlined the PHP

content, making it easier to follow You’ll see these improvements throughout Book V

Enhanced jQuery coverage: The jQuery AJAX library has improved

dramatically since the first edition I provide much more detailed age including full support for jQuery UI and numerous cool widgets and tools Book VII is much longer and more detailed than it was in the first edition

A new graphics chapter: A number of readers asked for more coverage

of graphics tools, especially Gimp I added a new chapter to Book VIII describing how to use Gimp to enhance your Web pages

Support for the Website Baker CMS: I use this CMS quite a bit in my

Web business, and I find it especially easy to modify I changed Book VIII, Chapter 3 to explain how to use and modify this excellent CMS

Various tweaks and improvements: No book is perfect (though I really

try) There were a few passages in the previous edition that readers found difficult I tried hard to clean up each of these areas Many thanks

to those who provided feedback!

www.it-ebooks.info

Trang 40

6 Icons Used in This Book

Icons Used in This Book

This is a For Dummies book, so you have to expect some snazzy icons, right?

I don’t disappoint Here’s what you’ll see:

This is where I pass along any small insights I may have gleaned in my travels

I can’t really help being geeky once in a while Every so often, I want to explain something a little deeper Read this to impress people at your next computer science cocktail party or skip it if you really don’t need the details

A lot of details are here I point out something important that’s easy to forget with this icon

Watch out! Anything I mark with this icon is a place where things have blown

up for me or my students I point out any potential problems with this icon

A lot of really great examples and software are on the CD Whenever I tion software or examples that are available on the CD, I highlight it with this icon

I try hard to answer all reader e-mails but sometimes I get behind Please be patient with me, and I’ll do my best to help

I can’t wait to hear from you and see the incredible Web sites you develop

Have a great time, discover a lot, and stay in touch!

www.it-ebooks.info

Ngày đăng: 15/02/2014, 19:20

TỪ KHÓA LIÊN QUAN