Book description
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.
Table of contents
- Copyright
- About the Author
- Acknowledgments
- Tell Us What You Think!
- Introduction
- Getting Started
-
The Language
- The Building Blocks
- Going with the Flow
-
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
- Summary
- Q&A
- Workshop
- Exercise
- Arrays
- Working with Strings
-
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
- Summary
- Q&A
- Workshop
- Exercises
-
Working with PHP
-
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
- Summary
- Q&A
- Workshop
- Exercises
-
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
- Summary
- Q&A
- Workshop
- Exercises
- Working with the DBA Functions
-
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
- Summary
- Q&A
- Workshop
- Exercises
- Beyond the Box
- Images On-the-Fly
- Working with Dates and Times
- Advanced Objects
- Working with Regular Expressions
- Saving State with Cookies and Query Strings
- Saving State with Session Functions
-
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
- Summary
- Q&A
- Workshop
- Exercises
- XML
-
Working with Forms
- Extending PHP
- Glossary
- Index
Product information
- Title: Sams Teach Yourself PHP in 24 Hours, Third Edition
- Author(s):
- Release date: December 2003
- Publisher(s): Sams
- ISBN: 0672326191
You might also like
book
Sams Teach Yourself PHP, MySQL™ and Apache in 24 Hours
Sams Teach Yourself PHP, MySQL, and Apache in 24 Hours combines coverage of three popular open-source …
book
Sams Teach Yourself C++ in 24 Hours, Sixth Edition
Sams Teach Yourself C++ in 24 Hours is a hands-on guide to the C++ programming language. …
book
Mastering PHP 7
Effective, readable, and robust codes in PHP Key Features [*] Leverage the newest tools available in …
book
Sams Teach Yourself PHP, MySQL® and Apache All in One, Fifth Edition
In just a short time, you can learn how to use PHP, MySQL, and Apache together …