13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

600 Chapter 27 Building User Authentication <strong>and</strong> Personalization<br />

Deleting Bookmarks<br />

When a user marks some bookmarks for deletion <strong>and</strong> clicks on the Delete BM link on<br />

the menu, the form containing the URLs is submitted. Each one of the check boxes is<br />

produced by the following code in the display_user_urls() function:<br />

echo "".htmlspecialchars($url)."<br />

<br />

";<br />

The name of each input is del_me[].This means that, in the <strong>PHP</strong> script activated by this<br />

form, you have access to an array called $del_me that contains all the bookmarks to be<br />

deleted.<br />

Clicking on the Delete BM option activates the delete_bms.php script, which is<br />

shown in Listing 27.24.<br />

Listing 27.24<br />

delete_bms.php—This Script Deletes Bookmarks from the Database<br />

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

Saved successfully!

Ooh no, something went wrong!