Post data in wp-admin to external database

Does the code that imports to the external DB need to be on a different page? Adding a conditional that checks if the form is submitted, to your callback function would work as well.

Then your form posts the data back to itself, checks if the form is submited and runs the import script instead of displaying the form.

That way you wont get the permissions error.

add_action('admin_menu', function() {
add_options_page('Add an Item', 'Add an Item', 'administrator', __FILE__, function() {

if(isset($_POST['submit']) && $_POST['submit'] == 'Send'){
    import_items();
}else
    add_item_form();
)};

function add_item_form(){
    <div class="wrap">
    <form method="POST">
        <input type="text" value="nothing" />
        <input type="text" value="nothing" />
        <input name="submit" type="submit" value="Send" />
    </form>
    </div>
}

function import_items(){

    //Your code from http://some/url/additem.php for importing items to the external DB goes here.

}

tech