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.

if ( !isset($_SESSION['user']) )<br />

{<br />

header("Location: ./");<br />

exit;<br />

}<br />

/*<br />

* Output the header<br />

*/<br />

$page_title = "Add/Edit Event";<br />

$css_files = array("style.css", "admin.css");<br />

include_once 'assets/common/header.inc.php';<br />

/*<br />

* Load the calendar<br />

*/<br />

$cal = new Calendar($dbo);<br />

?><br />

<br />

<br />

<br />

<br />

CHAPTER 6 ■ PASSWORD PROTECTION SENSITIVE ACTIONS AND AREAS<br />

After saving this file, attempt to navigate to http://localhost/admin.php while logged out. You’ll<br />

automatically be sent to http://localhost/.<br />

Ensuring Only Logged In Users Can Delete Events<br />

Also, to keep unauthorized users from deleting events, insert a check for a valid user session in the<br />

confirmdelete.php file:<br />

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

Saved successfully!

Ooh no, something went wrong!