02.06.2013 Views

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

?><br />

CHAPTER 5 ■ ADD CONTROLS TO CREATE, EDIT, AND DELETE EVENTS<br />

■ Caution You may want to include a time limit for tokens to increase security further. Making sure a token is no<br />

older than 20 minutes, for instance, helps prevent a user from leaving a computer unattended <strong>and</strong> having a<br />

mischievous user start poking around later. For more information on tokens <strong>and</strong> preventing CSRF, visit Chris<br />

Shiflett’s blog <strong>and</strong> read his article on the topic at http://shiflett.org/csrf.<br />

Creating a File to Display the Form<br />

Now that the method exists to display the form, you need to create a file that will call that method. This<br />

file will be called admin.php, <strong>and</strong> it will reside in the root level of the public folder (/public/admin.php).<br />

Similar to view.php, this file accomplishes the following:<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!