Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
PHP is a widely used server side scripting language used for producing dynamic web pages. In the PHP development lifecycle everyone face some common problem and considering this No Starch Press come with a good book "Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems" written by William Steinmetz with Brian Ward.
Wicked Cool PHP is a wide-ranging collection of complete PHP scripts that solve specific problems frequently encountered by PHP coders. Book contains 12 chapters covering 76 frequently encountered problems.
Chapter 1, "The FAQs of Lifeâ€”The Scripts Every PHP Programmer Wants (or Needs) to Know", answers several questions that frequently asked on PHP forums and discussion groups all over the world. This chapter gives quick solution and tricks on error we face while including Another File as a Part of Your Script, Highlighting Alternate Row Colors in a Table, Implementing pagination, dealing with Array. This chapter also gives a quick introduction on the most common templating solution Smarty.
php.ini which defines working environment of PHP. More people are aware with the power of php.ini. Chapter 2, â€œConfiguring PHPâ€ give a brief knowledge of PHP configuration Settings using php.ini, like Reading PHP's Settings, Error Reporting, suppressing Error Messages, extending the Script Run Time, dealing with Files Uploading, Registered Global, Magic Quotes, Extensions and many more tricks related to php.ini
Security is the major constrain in web development. You must always keep security in mind while developing your code. Chapter 3, â€œPHP Securityâ€, focuses the concept of Security Configuration in brief. You also get idea about SQL Injection Attacks and XSS Attacks and way to overcome on them thought techniques like Using SafeHTML or Protecting Data with a One-Way Hash. This chapter also trace on Encrypting Data with Mcrypt and Random Passwords Generating technique.
Web Forms are very useful and important while taking input, suggestion or feedback from user. Commonly data provided by an HTML form and we have to alert on Security Measures because Forms Are Not Trustworthy. Chapter 4, â€œWorking With Formsâ€ explore topics like Verification Strategies, Using $_POST, $_GET, $_REQUEST, and $_FILES to Access Form Data, Fetching Form Variables Consistently and Safely, Trimming Excess Whitespace, Importing Form Variables into an Array, Making Sure a Response Is One of a Set of Given Values, Using Multiple Submit Buttons. It also introduces us with advance form processing techniques like validating a Credit Card, Double-Checking a Credit Card's Expiration Date, Checking Valid Email Addresses and Checking American Phone Numbers.
Chapter 5, â€œWorking with Text and HTMLâ€ focus on string operations with elementary techniques like Extracting Part of a String, Making a String Uppercase, Lowercase, or Capitalized, Finding and Replacing Substrings, Stripping HTML Tags from Strings. Then topic goes in-depth with Finding and Fixing Misspelled Words with pspell, Regular Expressions and then to advance with Rearranging a Table, Creating a Screen Scraper, Converting Plaintext into HTML-Ready Markup, Automatically Hyperlinking URLs.
Chapter 6, â€œWorking with Datesâ€ shows you how to work with dates and times with PHP. PHP have good support for date manipulation but task becomes more tedious while interconnecting with MySQL. In this chapter we know more about How UNIX Time Works and MySQL Date Formats. This chapter also provides quick solution on Getting the Current Timestamp, Getting the Timestamp of a Date in the Past or Future, Formatting Dates and Times, Calculating the Day of the Week from a Given Date and Finding the Difference between Two Dates.
File manipulation is an important part of PHP programming. To accomplish your task you have perform lots of file related activities. Chapter 7, â€œWorking with Filesâ€ deals with File Permissions, Reading from and Writing to a File, Reading a Comma-Separated File, checking File Exists on server or not, deleting file.
While dealing with a shopping carts or accessing any secure pages; user tracking and sessions plays an important role. Chapter 8, â€œUser AND Session Trackingâ€ shows how to track userâ€™s data using Cookies and Sessions. Store user information in a cookie and display it. Check weather a User's Browser support Cookies, Extracting Client Information, Temporarily Storing Data in Sessions, Session Timeouts, Redirecting and Forcing a User to Use SSL-Encrypted Pages. At the end all the above factor get used to generate A Simple Login System.
In PHP we need to manipulate much email to send confirmation messages to users and administrators about account settings, orders, and so on. Chapter 9, "Working With email" illustrate how mail() works, Installing and Using PHPMailer to Send Mail, Using Email to Verify User Accounts.
Chapter 10, "Working with Images" shows how to create and manipulate images such as GIFs and JPEGs. In this chapter we get tricks to generate CAPTCHA (Security) Image to secure our PHP form processing or any kind of user interaction with our websites. PHP GD library provide flexibility to generate dynamic CAPTCHA (Security) Image and Images Thumbnail. Script describe here shows us how to do it using GD.
Chapters 11, â€œUsing cURL to interact with Web Servicesâ€ introduce how to use cURL PHP library to handle the connection between your webserver and other webservers. Here we get more idea about Using Cookies with cURL, Using Mapping Web Services, Using PHP and Simple Object Access Protocol (SOAP) to Request Data from Amazon.com, Transforming XML into a Usable Form and Building a Web Service.
Chapter 12, â€œIntermediate Projectsâ€ explore three sets of scripts that implement common features on many content-based websites: a voting system (User Poll), an electronic card service, and a blog.
This book also has an APPENDIX (Appendix A) containing schema of a product_info table. product_info table containing details of the inventory for a hypothetical store which get referred in book several time while describing solutions.
PHP is popular web development language. Also Lots of Tips n tracks, FAQ's and tutorials available freely on web. But they are scattered and very difficult to choose a right solution among them. While during development stage, time is an important factor and this book is a handy solution on the problems commonly faced by every programmer during there PHP development experience.
I like to recommend this book to new and enthusiastic PHP coders.
Title: Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Authors: William Steinmetz with Brian Ward
Publisher: No Starch Press
Paperback: 224 pages
ISBN 10: 1-59327-173-5
ISBN 13: 978-1-59327-173-2
Product Dimensions: 9.1 x 6.9 x 0.8 inches