Results 1 to 5 of 5

Thread: admin include page parameter

  1. #1
    surferbloggy is offline Hello World
    Join Date
    May 2010
    Posts
    45

    Default admin include page parameter

    hi! another problem: i have this function:

    Code:
        function show_menu()  {
        
            
            switch ($_GET['page']){
                case "show_orders_page" :
                    include_once ( dirname (__FILE__) . '/show_orders.php' );        // nggallery_admin_options
                    show_orders_page();
                    
                    break;
                    
                case "deliver_orders_page" :
                    include_once ( dirname (__FILE__) . '/show_orders.php' );    
                    //include_once ( dirname (__FILE__) . '/deliver_order.php' );    
                      
                    deliver_orders_page();
                    
                    break;
            }
        }
    if the link is
    wpdemo/wp-admin/admin.php?page=show_orders_page
    the include works, the function works everything is ok instead

    if the link is /wp-admin/admin.php?page=deliver_orders_page&iduser=1
    it tells me:
    You do not have sufficient permissions to access this page.

    what can I do??

  2. #2
    andreasnrb's Avatar
    andreasnrb is offline Kegger
    Join Date
    Jun 2009
    Posts
    595

    Default

    Each page needs to be added using the admin subpage function. If you don't want multiple menu links/pages add a single page as parent and then use a query variable to switch pages.
    add_subpage(yourpluginmainpage)
    so you get ?page=yourpluginmainpage
    and can link to ?page=yourpluginmainpage&view=show_orders_page etc.

  3. #3
    surferbloggy is offline Hello World
    Join Date
    May 2010
    Posts
    45

    Default

    thank you very much i made a subpage menu but how can i see it when i click to the link:

    <a href=\"?page=show_orders_page&view=deliver&iduser= $iduser\">deliver</a>

    where i have to put if($_GET['view']=="deliver") and after that can you help me??thank you

  4. #4
    surferbloggy is offline Hello World
    Join Date
    May 2010
    Posts
    45

    Default

    if i put this if($_GET['view']=="deliver") in show_orders_page it works but it isn't the submenu page how can i do to see the submenu page??

  5. #5
    andreasnrb's Avatar
    andreasnrb is offline Kegger
    Join Date
    Jun 2009
    Posts
    595

    Default

    if(!isset($_GET['view']))
    load the show_orders_page

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •