I am new to wordpress plugin development. I have created a list page and an add item page. When I add successfully, I want to redirect and it is giving me this error.


![enter image description here][1]

I have checked many sources but unable to find the solution so far

 1. I have used `wp_redirect('admin.php?page=ccURLList'); exit;` it gives the attached error
 2. I have used `no-header` in the query string of form submission, it does work but in case of any error I wanted to show the page again and that page is without any sidebar or wp stuff
 3. When i move the `wp_redirect` to my main file `clickCounter.php` it says function is unknown


If any of you can resolve this issue, it will be highly appreciated.

**EDIT**


`clickCounter.php` is my main file. It creates menus etc. 

I have a list page which is working. 

I have an add page. I have put the wp_redirect on the very first lines after <?php tag

    <?php
    // ccURLAdd.php my add page
    if (!defined('ABSPATH'))
        die('You are not allowed to call this page directly.');
    
    wp_redirect('admin.php?page=click-counter');
    exit;

Below is my main file

    <?php
    // clickCounter.php my main page.
    /* some plugin info */
    add_action('admin_menu', 'ccAdminMenu');
    function ccAdminMenu()
    {
        add_menu_page("Click Counter", "Click Counter", 8, 'click-counter', "ccAdminMenuListUrls", CC_HTML_WEB . "/images/icon.png");
        add_submenu_page('click-counter', 'Add New Link', 'Add Link', 8, 'click-counter-url-new', 'ccAdminAddUrl');

    }
    function ccAdminAddUrl()
    {
        include 'ccURLAdd.php';
    }


  [1]: https://i.sstatic.net/5t4zE.png