Learn how to build dynamic and secure websites using modern PHP with MySQL databases.

PHP today is a mature, robust language focused on programming web applications and sites. This book gives you an introduction to its syntax, built-in data structures, and scalar data types. You’ll also see how to work with cookies, sessions, and web requests using native PHP functions and features. This approach gives you a solid grounding for working in any other PHP application from WordPress, to modern frameworks, to legacy applications. Each chapter includes plenty of code examples to reinforce the concepts introduced as well as suggested exercises for the reader.

The book also walks you through building a typical Create-Read-Update-Delete (CRUD) application, starting with setting up a development environment through building the pages and forms required. Along the way, you’ll get solid, practical advice on how to add authentication, handle file uploads, safely store passwords, application security, and more.

Download Code Samples

Read a Sample

Topics Covered

  • PHP Script Execution
  • Setting up a Development Environment
  • Using Variables, Strings, and Basic Operators
  • Working with Arrays
  • Comparing Variables, Logical Operators, and Flow Control
  • Writing Counting and Sentinel Loops
  • Reusing code with custom functions
  • Working with HTML Forms
  • Validating User Input
  • Saving, Updating, and Deleting Data in a Database
  • Querying and Displaying Database Result Sets
  • Safely Working with File Uploads
  • Adding Basic and Session-based User Log Ins
  • Persisting User data with Cookies and Sessions
  • Securing against Common Web Attacks and Vulnerabilities
  • Building a shopping-cart-like feature.
  • An Introduction to Object-Oriented Code in PHP

About the Author

Written by PHP professional Kenneth E. Marks, this book provides a quick-start introduction to familiarize you with the PHP language. At the same time, it offers real-world advice on how to use PHP today. Whether you’re coming from another language, taking over a legacy application, or looking to build one from scratch, he’ll guide you towards making one you can be proud of.