[ create a new paste ] login | about

Link: http://codepad.org/I68TSJCm    [ raw code | output | fork ]

BluePanther - PHP, pasted on Sep 11:
<?php
/*
 * Gallery controller page - galleryadmin.php
 * This page is the controller for gallery management
 * This page should be used as the admin 'homepage'
 *
 * Non-database solution
 *
 * @author Aaron Maclean
*/

// Hardcoded password for authorised people to C-U-D
$password = 'ChangeMe!';

private function create($input){
    global $password;
    if($input != FALSE){
    }
    else {
        // display form
    }
}

private function manage($input){
    global $password;
    if($input != FALSE){
    }
    else {
        // display form
    }
}

// galleryadmin.php?task=
if(isset($_GET['task'])){
    switch($_GET['task']){
        case 'create':
            echo ( (!empty($_POST)) ? create($_POST) : create(FALSE) );
            break;
        case 'manage':
            echo ( (!empty($_POST)) ? manage($_POST) : manage(FALSE) );
            break;
        default:
            echo 'Task not recognised.';
            break;
    }
}
?>


Output:
1
2

Parse error: syntax error, unexpected T_PRIVATE on line 15


Create a new paste based on this one


Comments: