One day, in the not too distant future, I fully expect my grandmother to ask me about Facebook. She’s particularly hip, as grandmothers go, and is already all over email. She even occasionally “surfs” the Web to read up on the latest events in her native South Africa! You might not think she falls into Facebook’s target demographic, but I would hate to be the person standing between her and her Mac if anyone told her that she could learn even more about her beloved Toronto Maple Leafs by registering for a Facebook account. She is, after all, their number-one...
This book is intended for anyone starting out with PHP programming. If you’ve previously worked in another programming language such as Java, C#, or Perl, you’ll probably pick up the concepts in the earlier chapters quickly; however, the book assumes no prior experience of programming or of building Web applications.
In the “old days” of the Internet, most web pages were nothing more than text files
containing HTML. When people visited your site, your web server simply made the
file available to their browsers. This approach started out fine, but as web sites grew,
and issues such as design and navigation became more important, developers found
that maintaining consistency across hundreds of HTML files was becoming a massive
CHAPTER 6 ■ PASSWORD PROTECTION SENSITIVE ACTIONS AND AREAS
include_once 'assets/common/footer.inc.php'; ? Now save this code and try to directly access http://localhost/confirmdelete.php while logged out. As expected, you’ll be redirected to http://localhost/ instead.
In this chapter, you learned how to add user authorization to your calendar app, which means only authorized users can now make modifications to the calendar. You learned how to create the Admin class, check login credentials, display admin tools to admins only, and limit access to admin pages.
PAGES THAT REMEMBER: SIMPLE LOGIN AND MULTIPAGE FORMS
session_regenerate_id(); break; } The time() function returns a current timestamp. By storing it in $_SESSION['start'], it becomes available to every page that begins with session_start(). 2. When a session times out, just dumping a user unceremoniously back at the login screen isn t very friendly, so it s a good idea to explain what s happened. In login.