View Single Post
12-24-2006, 12:42 AM
#4
jono1 is offline jono1
jono1's Avatar
Status: Non-conformist
Join date: Jul 2005
Location: Canberra, Australia.
Expertise:
Software:
 
Posts: 1,172
iTrader: 0 / 0%
 

jono1 is on a distinguished road

  Old

It would be more accessible to have a confirmation page within the CMS itself, not using javascript, because users who have javascript disabled, or use screen-reader based browsers (that is, browsers for visually-impaired people) would probably run into problems, and might end up deleting pages without meaning to.

The confirmation page would be pretty simple to incorporate into your CMS - something like:
PHP Code:
if(isset($_GET['confirm'])){
    if(
$_GET['confirm']==true){
        
// Page deletion code here.
    
}
} else {
    echo 
"Are you sure you want to delete this page? This action can not be undone.<br />";
    echo 
"<a href=\"index.php?act=delete&id={$_GET['id']}&confirm=true\">I'm sure.</a> "// {$_GET['id']} inserts the page to delete from the URL of the page you're currently on
    
echo "<a href=\"\">Cancel.</a>"// Point this link to previous page