Learning PHP, MySQL, and JavaScript - Robin Nixon.pdf

Learning PHP, MySQL, and JavaScript - Robin Nixon.pdf -...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Learning PHP, MySQL, and JavaScript Robin Nixon Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo
Image of page 2
Learning PHP, MySQL, and JavaScript by Robin Nixon Copyright © 2009 Robin Nixon. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles ( ). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected] . Editor: Andy Oram Production Editor: Sumita Mukherji Copyeditor: Nancy Kotary Proofreader: Kiel Van Horn Indexer: Ellen Troutman Zaig Cover Designer: Karen Montgomery Interior Designer: David Futato Illustrator: Robert Romano Printing History: July 2009: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Learning PHP, MySQL, and JavaScript , the image of sugar gliders, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein. TM This book uses RepKover™, a durable and flexible lay-flat binding. ISBN: 978-0-596-15713-5 [M] 1246467361
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Table of Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii 1. Introduction to Dynamic Web Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 HTTP and HTML: Berners-Lee’s Basics 2 The Request/Response Procedure 2 The Benefits of PHP, MySQL, and JavaScript 5 Using PHP 5 Using MySQL 6 Using JavaScript 7 The Apache Web Server 8 About Open Source 9 Bringing It All Together 9 Test Your Knowledge: Questions 11 2. Setting Up a Development Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 What Is a WAMP, MAMP, or LAMP? 13 Installing a WAMP on Windows 14 Overcoming Installation Problems 14 Testing the Installation 16 Alternative WAMPs 18 Installing a MAMP on Mac OS X 19 Some Final Tweaking 24 Other Alternatives 25 Installing a LAMP on Linux 25 Working Remotely 26 Logging In 27 Using FTP 27 Using a Program Editor 28 Using an IDE 30 Test Your Knowledge: Questions 32 iii
Image of page 4
3. Introduction to PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Incorporating PHP Within HTML 33 Calling the PHP Parser 34 This Book’s Examples 35 The Structure of PHP 36 Using Comments 36 Basic Syntax 37 Understanding Variables 38 Operators 42 Variable Assignment 45 Multiple-Line Commands 47 Variable Typing 49 Constants 50 The Difference Between the echo and print Commands 51 Functions 52 Variable Scope 53 Test Your Knowledge: Questions 58 4. Expressions and Control Flow in PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Expressions 61 Literals and Variables 62 Operators 63 Operator Precedence 64 Associativity 66 Relational Operators 67 Conditionals 70
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern