O'Reilly logo

PHP & MySQL: The Missing Manual, 2nd Edition by Brett McLaughlin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Cookies, Sign-Ins, and Ditching Crummy Pop-Ups

It’s time to start winding down. You’ve gone from seeing PHP as some strange, cryptic arrangement of angle brackets and dollar signs to building your own application, including integration with a MySQL database, authentication, redirection, and a decent set of utility functions. You might not be able to sell your modest application for a million dollars. But you should have a good sense of how to think in PHP, and how scripts are structured to solve problems.

Before you can twist and bend this application and your new skills to other purposes, there are still some lingering issues that you need to handle. A few of these are nice-to-haves; and some are downright necessities if you’re going to spend your career writing web applications.

Here are just a few things that you could give your application needs to round out both its usefulness and your skills:

  • A better login screen. Nobody likes a bland, gray pop-up dialog box; they want a branded, styled login form.

  • Better messaging to indicate whether a user is logged in.

  • A way to log out.

  • Two levels of authentication: one to get to the main application, and then administrator-level authentication to get to a page like show_users.php or delete_user.php.

  • Some basic navigation. That navigation should change based on a user’s login and the groups to which that user belongs.

These are mostly related to the idea of logging in, and that’s no accident. Whether it’s a good-looking login screen ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required