Sams Teach Yourself PHP in 24 Hours


Think of all the things you could do in 24 hours. Go sightseeing. Read a book. Learn PHP. Sams Teach Yourself PHP in 24 Hours is a unique learning tool that is divided into 24 one-hour lessons over five sections. Starting with the basics, you will discover the fundamentals of PHP and how to apply that knowledge to create dynamic websites with forms, cookies and authentication functions. You will also find out how to access databases, as well as how to integrate system components, e-mail, LDAP, network sockets and...

See more details below
Paperback (Subsequent)
$34.75 price
(Save 13%)$39.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (21) from $1.99   
  • New (7) from $18.00   
  • Used (14) from $1.99   
Sending request ...


Think of all the things you could do in 24 hours. Go sightseeing. Read a book. Learn PHP. Sams Teach Yourself PHP in 24 Hours is a unique learning tool that is divided into 24 one-hour lessons over five sections. Starting with the basics, you will discover the fundamentals of PHP and how to apply that knowledge to create dynamic websites with forms, cookies and authentication functions. You will also find out how to access databases, as well as how to integrate system components, e-mail, LDAP, network sockets and more. A support website includes access to source code, PHP updates, errata and links to other relevant websites. Sams Teach Yourself PHP in 24 Hours is a quick and easy way to learn how to create interactive websites for your end user.

Read More Show Less

Product Details

  • ISBN-13: 9780672326196
  • Publisher: Sams
  • Publication date: 12/16/2003
  • Series: Sams Teach Yourself Series
  • Edition description: Subsequent
  • Edition number: 3
  • Pages: 550
  • Product dimensions: 7.38 (w) x 9.06 (h) x 1.20 (d)

Meet the Author

Matt Zandstra is a writer and consultant specializing in server programming. With his business partner, Max Guglielmino, he runs Corrosive (, a technical agency that plans, designs and builds Internet applications. Matt is interested in all aspects of object-oriented programming and is currently exploring enterprise design patterns for PHP 5. When he is not reading, writing or thinking about coding in PHP and Java, Matt shoots alien invaders in the park with his four-year-old daughter Holly. He lives by the sea in Brighton, Great Britain, with his partner Louise McDougall and their children Holly and Jake.

Read More Show Less

Table of Contents

(NOTE: Each chapter concludes with a Summary. Q&A. Workshop. and Exercise.)



Hour 1. PHP: From Home Page to Web Enterprise.

What Is PHP? What Need Does PHP Fulfill? What's New in PHP 5. The Zend Engine. Why Choose PHP? What's New in This Edition.

Hour 2. Installing PHP.

Platforms, Servers, Databases, and PHP. Where to Find PHP and More. Installing PHP for Linux and Apache. Some configure Options. Configuring Apache. php.ini. Help!

Hour 3. A First Script.

Our First Script. Combining HTML and PHP. Adding Comments to PHP Code.


Hour 4. The Building Blocks.

Variables. Data Types. Operators and Expressions. Constants.

Hour 5. Going with the Flow.

Switching Flow. Loops. Code Blocks and Browser Output.

Hour 6. Functions.

What Is a Function? Calling Functions. Defining a Function. Returning Values from User-Defined Functions. Dynamic Function Calls. Variable Scope. Saving State Between Function Calls with the static Statement. More About Arguments. Creating Anonymous Functions. Testing for Function Existence.

Hour 7. Arrays.

What Is an Array? Creating Arrays. Associative Arrays. Multidimensional Arrays. Accessing Arrays. Manipulating Arrays. Sorting Arrays. Functions Revisited.

Hour 8. Working with Strings.

Formatting Strings. Investigating Strings. Manipulating Strings.

Hour 9. Objects.

What Is an Object? Creating an Object. Object Properties. Object Methods. Limiting Access to Object Properties. Limiting Access to Object Methods. Constraining Arguments to Methods with Hints. Inheritance. Testing Classes and Objects. Automatically Loading Include Files with __autoload(). Storing and Retrieving Objects.


Hour 10. Working with Forms.

Superglobal Variables. The $_SERVER Array. A Script to Acquire User Input. Importing User Input into Global Scope. Accessing Form Input with User-Defined Arrays. Combining HTML and PHP Code on a Single Page. Using Hidden Fields to Save State. Redirecting the User. File Upload Forms and Scripts.

Hour 11. Working with Files.

Including Files with include(). Using include_once() and include_path to Manage Larger Projects. Testing Files. Creating and Deleting Files. Opening a File for Writing, Reading, or Appending. Reading from Files. Reading the Contents of a File with file_get_contents(). Writing or Appending to a File. Writing Data to a File with file_put_contents(). Working with Directories.

Hour 12. Working with the DBA Functions.

Beneath the Abstraction. Opening a Database. Adding Data to the Database. Amending Elements in a Database. Reading from a Database. Determining Whether an Item Exists in a Database. Deleting an Item from a Database. Adding Complex Data Structures to a Database. An Example.

Hour 13. Database Integration-SQL.

A (Very) Brief Introduction to SQL. Connecting to the MySQL Database Server. Selecting a Database. Finding Out About Errors. Adding Data to a Table. Acquiring the Value of an Automatically Incremented Field. Accessing Information. Changing Data. SQLite: A Lightweight SQL Engine. Selecting Data. Using the PEAR DB Package.

Hour 14. Beyond the Box.

Server Variables Revisited. A Brief Summary of an HTTP Client/Server Negotiation. Getting a Document from a Remote Address. Converting IP Addresses and Hostnames. Making a Network Connection. Sending Mail with the mail() Function. An Introduction to Streams.

Hour 15. Images On-the-Fly.

Checking Your Configuration with gd_info(). Creating and Outputting Images. Acquiring Color. Drawing Lines. Applying Color Fills. Drawing an Arc. Drawing a Rectangle. Drawing a Polygon. Making a Color Transparent. Working with Text. Bringing It Together.

Hour 16. Working with Dates and Times.

Getting the Date with time(). Converting a Timestamp with getdate(). Converting a Timestamp with date(). Creating Timestamps with mktime(). An Example. A Date Pull-down Library.

Hour 17. Advanced Objects.

Objects and Constants. Static Properties. Static Methods. Intercepting Calls to Object Properties and Methods. Final Methods. Cleaning Up Using Destructors. Managing Error Conditions with Exceptions. Tools for Building Object Hierarchies. Passing and Assigning Objects.

Hour 18. Working with Regular Expressions.

Perl Compatible Regular Expressions.

Hour 19. Saving State with Cookies and Query Strings.

Cookies. Setting a Cookie with PHP. Working with the Query String. Creating a Query String.

Hour 20. Saving State with Session Functions.

What Are Session Functions? Starting a Session with session_start(). Working with Session Variables. Destroying Sessions and Unsetting Elements. Passing Session IDs in the Query String. Encoding and Decoding Session Variables.

Hour 21. Working with the Server Environment.

Opening Pipes to and from Processes with popen() and proc_open(). Running Commands with exec(). Running External Commands with system() or the Backtick Operator. Plugging Security Holes with escapeshellcmd(). Running External Applications with passthru(). Calling an External CGI Script with the virtual() Function.

Hour 22. XML.

What Is XML? XML Parser Functions. An Introduction to the DOM XML Functions. XSL: A Brief Discussion. Introducing SimpleXML.


Hour 23. PEAR: Reusable Components to Extend the Power of PHP.

What Is PEAR? Some PEAR Packages in Action. PEAR and Your Own Code.

Hour 24. Toward a Framework for Larger Projects.

Principles and Problems. The Controller Object. The RequestHelper and DataStore Classes. The CommandFactory Class. The Command Class. The Dispatcher Class. Working with the Framework. Where Now, and Was It Worth It?



Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)