Book description
PHP is a server-side scripting language that enables you to develop dynamic sites that engage users in ways that are simply not possible using only HTML and CSS.PHP for Absolute Beginners takes a practical approach to teaching you how to build dynamic content for your website using PHP. You'll quickly get started with practical PHP projects, learning how to build a dynamic image gallery. By the end of the book youll will have developed a personal blog complete with a password protected admin module.
PHP for Absolute Beginners won't swamp you with every detail of the full PHP language up front instead, youll be introduced to a small, versatile subset of PHP and learn to use it creatively to develop dynamic web sites. In the process you will learn to use variables, control structures, functions, and objects to your advantage. You will learn how to plan and create databases and how to organize your PHP scripts beautifully. At the end of the book, you will be a confident PHP user, ready to take the next steps in creating great websites.
Table of contents
- Cover
- Title
- Copyright
- Contents at a Glance
- Contents
- About the Authors
- About the Technical Reviewer
- Acknowledgments
- Introduction
-
Part I: PHP/MySQL Basics
- Chapter 1: Setting Up a PHP Development Environment
- Chapter 2: Understanding PHP: Language Basics
- Chapter 3: Form Management
- Chapter 4: Building a Dynamic Image Gallery with Image Upload
-
Chapter 5: Spicing Up Your Image Gallery with JavaScript and CSS
- Client-Side vs. Server-Side Programming
-
Coding a Lightbox Gallery
- Embedding an External JavaScript File
- Preparing the Page_Data Class for JavaScript Files
- Preparing the Page Template for JavaScript Files
- Writing and Running an External JavaScript File
- Using window.console.log( )
- JavaScript Arrays
- Simple Progressive Enhancement
- Creating Markup for the Overlay and Big Image
- Showing the Overlay
- Hiding the Overlay and Resize Thumbnails
- Showing a Big Image
- Hiding the Big Image
- Using a CSS Animation
- Coding Challenge
- Summary
-
Chapter 6: Working with Databases
- The Basics of MySQL Data Storage
- Manipulating Data with SQL
- Developing a Database for the Poll
-
Coding a Database-Driven Site Poll
- Separating Concerns with MVC
- Creating the Poll Project
- Making a Poll Controller
- Making a Poll Model
- Making a Poll View
- Hooking Up Poll View with Poll Model
- Coding Is Like Playing the Blues
- Connecting to MySQL from PHP
- Using Constructor Arguments
- Sharing the Database Connection with the Poll Model
- Retrieving Data with a PDOStatement
- PDO and PDOStatement Objects
- Showing a Poll Form
- Updating a Database Table According to Form Input
- Summary
-
Part II: A Blogging System
- Chapter 7: Building the Entry Manager
- Chapter 8: Showing Blog Entries
-
Chapter 9: Deleting and Updating Entries
-
Creating a Model for Administrative Links
- Displaying Administrative Links
- Populating Your Form with the Entry to Be Edited
- Handling Entry Deletion
- Deleting Entries from the Database
- Responding to Delete Requests
- Preparing a Model to Update Entries in the Database
- Controller: Should I Insert or Update?
- Communicating Changes
- Insisting on a Title
- Improving Editor Usability with Progressive Enhancement
- Embedding Your External JavaScript
- Showing a Warning If Title Is Empty
- Other Usability Flaws
- A Coding Challenge: Fix a Usability Flaw
- Summary
-
Creating a Model for Administrative Links
-
Chapter 10: Improving Your Blog with User Comments and Search
-
Building and Displaying the Comment Entry Form
- A Combined View
- Creating a Comment Table in the Database
- Using a Foreign Key
- Building a Comment_Table Class
- Staying DRY with Inheritance
- Is-a Relationships
- Using Inheritance in Your Code
- Inserting New Comments into the Database
- Retrieving All Comments for a Given Entry
- Inserting a Comment Through the Comment Form
- Practice Makes Perfect
- Searching for Entries
- Summary
-
Building and Displaying the Comment Entry Form
- Chapter 11: Adding Images to Blog Entries
- Chapter 12: Password Protection
- Chapter 13: Going Public with Your Blog
- Index
Product information
- Title: PHP for Absolute Beginners
- Author(s):
- Release date: August 2014
- Publisher(s): Apress
- ISBN: 9781430268147
You might also like
book
PHP and MySQL® Web Development, Fourth Edition
PHP and MySQL Web Development, Fourth Edition The definitive guide to building database-drive Web applications with …
book
Advanced PHP Programming
Over the past three years PHP has evolved from being a niche language used to add …
book
Learning PHP 5
PHP has gained a following among non-technical web designers who need to add interactive aspects to …
book
Object-Oriented PHP
Object-Oriented PHP shows developers how to take advantage of the new object-oriented features of PHP. Working …