Ajax in plugin settings

Hey guys I'm kind of stuck.

In my plugin settingspage in Elgg 1.8 I would need to generate some php files, so I was thinking of using ajax to call a php script that generates the file i need, nothing seems to happen. When trying to return something from another php file into my module settings page via Ajax i get a page that has the following text on it: Invalid Admin Section.

I'm thinking it just isn't executing the external php file. Is there a way i can turn this limit off so i can call any php page i want via Ajax?

Kind regards