Forums

Error when using GET on admin page (2 posts)

  1. huggie
    Member
    Posted 2 years ago #

    I've created an options page for my plugin which is working brilliantly. It has a form which submits back to itself without any issues at all.

    Submitting a POST request works as expected, but if I try to submit a GET request to the same page I get a permission error:
    "You do not have sufficient permissions to access this page."
    The URL that's appearing for the get request is:

    http://localhost/wp-admin/options-general.php?page=my-plugin.php/my_plugin.php?action=trash&id=1

    Should I be able to submit a GET request to an admin page without error? I know about nonce, but it isn't required is it?

    Cheers
    Rich

  2. huggie
    Member
    Posted 2 years ago #

    This can be ignored now, I realised what the issue was.

    ?page=my-plugin/my_plugin.php was already being passed as a parameter to options-general.php so instead of adding ?action=trash I should have been adding &action=trash

    Rich

Topic Closed

This topic has been closed to new replies.

About this Topic