Forum
Application file only available when logged in
I have an application I built that handles saving form data to the perch DB and displaying it in the admin area. Other than a process.php file which handles my form, the app is admin only.
I've noticed that when I'm logged out of perch, my AJAX post request to that process.php file returns a 403 forbidden error. Is there some sort of setting I'm missing that I need to enable to make process.php accessible for posting when not logged in?
What's your
process.php
file doing? If you've hooked it up like a control panel page, it'll try to authenticate you. You need to treat it the same as yourruntime.php
In process.php I'm just including the perch API, making a class that extends PerchAPI_Factory, and then I have a method that uses perchDB to save the form data to the DB.
Here's my code:
Am I hooking into the API the wrong way by including core/inc/api.php?
Yes, include the
perch/runtime.php
file instead.Thanks!