0

リダイレクト ページの設定に問題があります。読み込めないようです。

現在、これはページのケースを処理しますが、何らかの理由でデフォルトに移行しませんか?? ページが存在しません。

このビットが機能していません。何らかの理由でデフォルトに切り替わりませんか?

   //get the page information
    $pageInfo = $model -> getPageInfo($_GET['page']);

    //select which page to include when the user clicks
    //on either register/home/my account/my bids/my sell/completed auctions/edit etc..etc..etc..
    switch($_GET['page']) {

        case 'Register':
            include 'views/register.php';
            $view = new HomeView($pageInfo, $model);
            break;

        case 'Home':
            include 'views/homeView.php';
            $view = new HomeView($pageInfo, $model);
            break;

        case 'My Account':
            include 'views/myaccount.php';
            $view = new myaccount($pageInfo, $model);
            break;

        case 'My Bids':
            include 'views/mybids.php';
            $view = new Mybids($pageInfo, $model);
            break;

        case 'My Sell':
            include 'views/mysell.php';
            $view = new mysell($pageInfo, $model);
            break;

        case 'Completed Auctions':
            include 'views/checkout.php';
            $view = new checkout($pageInfo, $model);
            break;

        case 'editProduct':
            include 'views/editProductView.php';
            $view = new EditProductView($pageInfo, $model);
            break;

        case 'addProduct':
            include 'views/addProductView.php';
            $view = new AddProductView($pageInfo, $model);
            break;

        case 'deleteProduct':
            include 'views/deleteProductView.php';
            $view = new DeleteProductView($pageInfo, $model);
        break;

        case 'deleteUser':
            include 'views/deleteUserView.php';
            $view = new DeleteUserView($pageInfo, $model);
        break;

        case 'search':
            include 'views/search.php';
            $view = new search($pageInfo, $model);
        break;   

        case 'product':
            include 'views/productView.php';
            $view = new ProductView($pageInfo, $model);
        break;

        default: 
            include 'views/404.php';
            $view = new error($pageInfo,$model);
        break;
4

2 に答える 2

0
if($_GET['page']){
    switch ($_GET['page']) {
    case 'product':
        include 'views/productView.php';
        $view = new ProductView($pageInfo, $model);
        break;
    default:
        include 'views/404.php';
        $view = new error($pageInfo,$model);
    }
}    

動作するはずです。チェックに追加の検証を追加してif($_GET...ください

于 2013-04-04T12:30:09.863 に答える