PHP Solutions: Dynamic Web Design Made Easy

Book description

You want to make your websites more dynamic by adding a feedback form, creating a private area where members can upload images that are automatically resized, or perhaps storing all your content in a database. The problem is, you're not a programmer and the thought of writing code sends a chill up your spine. Or maybe you've dabbled a bit in PHP and MySQL, but you can't get past baby steps. If this describes you, then you've just found the right book.

PHP and the MySQL database are deservedly the most popular combination for creating dynamic websites. They're free, easy to use, and provided by many web hosting companies in their standard packages. Unfortunately, most PHP books either expect you to be an expert already or force you to go through endless exercises of little practical value. In contrast, this book gives you real value right away through a series of practical examples that you can incorporate directly into your sites, optimizing performance and adding functionality such as file uploading, email feedback forms, image galleries, content management systems, and much more. Each solution is created with not only functionality in mind, but also visual design.

But this book doesn't just provide a collection of ready-made scripts: each PHP solution builds on what's gone before, teaching you the basics of PHP and database design quickly and painlessly. By the end of the book, you'll have the confidence to start writing your own scripts, or if you prefer to leave that task to others, to adapt existing scripts to your own requirements.

Right from the start, you're shown how easy it is to protect your sites by adopting secure coding practices. The book has been written with an eye on forward and backward compatibility recommending PHP 5 techniques, but providing alternative solutions for servers still running PHP 4.3. All database examples demonstrate how to use the original MySQL extension, MySQL Improved, or the PHP Data Objects (PDO) introduced in PHP 5.1, letting you choose the most suitable option for your setup.

Table of contents

  1. Title Page
  2. Contents at a Glance
  3. Contents
  4. About the Author
  5. About the Technical Reviewer
  6. About the Cover Image
  7. Introduction
  8. 1 WHAT IS PHP—AND WHY SHOULD I CARE?
    1. Embracing the power of code
    2. How to use this book
    3. A note about versions
    4. So, let's get on with it ...
  9. 2 GETTING READY TO WORK WITH PHP
    1. What you need to write and test PHP pages
    2. What you need for a local test environment
    3. Setting up on Windows
    4. Setting up on Mac OS X
    5. Checking your PHP settings (Windows and Mac)
    6. What's next?
  10. 3 HOW TO WRITE PHP SCRIPTS
    1. PHP: The big picture
    2. PHP: A quick reference
    3. PHP quick checklist
  11. 4 LIGHTENING YOUR WORKLOAD WITH INCLUDES
    1. Including code from other files
    2. Summary
  12. 5 BRINGING FORMS TO LIFE
    1. How PHP gathers information from a form
    2. Sending email
    3. Validating user input
    4. Handling multiple-choice form elements
    5. Redirecting to another page
    6. Summary
  13. 6 UPLOADING FILES
    1. How PHP handles file uploads
    2. Uploading files
    3. Points to watch with file uploads
  14. 7 USING PHP TO MANAGE FILES
    1. Checking that PHP has permission to open a file
    2. Reading and writing files
    3. Exploring the file system
    4. Opening remote data sources
    5. Creating a download link
    6. Summary
  15. 8 GENERATING THUMBNAIL IMAGES
    1. Checking your server's capabilities
    2. Manipulating images dynamically
    3. Resizing an image automatically on upload
    4. Transferring your test files to a remote server
    5. Summary
  16. 9 PAGES THAT REMEMBER: SIMPLE LOGIN AND MULTIPAGE FORMS
    1. What sessions are and how they work
    2. Using sessions to restrict access
    3. Using file-based authentication
    4. Passing information through multipage forms
    5. Coming up . . .
  17. 10 SETTING UP MYSQL AND PHPMYADMIN
    1. Why MySQL?
    2. Installing MySQL on Windows
    3. Setting up MySQL on Mac OS X
    4. Using MySQL with a graphical interface
    5. Backup and data transfer
    6. Looking ahead ...
  18. 11 GETTING STARTED WITH A DATABASE
    1. How a database stores information
    2. Setting up the phpsolutions database
    3. Choosing the right column type in MySQL
    4. Connecting to MySQL with PHP
    5. Summary
  19. 12 CREATING A DYNAMIC ONLINE GALLERY
    1. Why not store images in a database?
    2. Planning the gallery
    3. Converting the gallery elements to PHP
    4. Building the dynamic elements
    5. Summary
  20. 13 MANAGING CONTENT
    1. Keeping your data safe
    2. Setting up a content management system
    3. Reviewing the four essential SQL commands
    4. Security and error messages
    5. Summary
  21. 14 SOLUTIONS TO COMMON PHP/MYSQL PROBLEMS
    1. Displaying a text extract
    2. Let's make a date
    3. Working with multiple database tables
    4. Summary
  22. 15 KEEPING INTRUDERS AT BAY
    1. Choosing an encryption method
    2. Using one-way encryption
    3. Using two-way encryption
    4. Updating user details
    5. Where next?
  23. Index

Product information

  • Title: PHP Solutions: Dynamic Web Design Made Easy
  • Author(s):
  • Release date: November 2006
  • Publisher(s): Apress
  • ISBN: 9781590597316