Wierd fix on this one. I had to move the php scripts out of the assets folder it wouldn’t execute them and also reupload them from the local site - although nothing had changed the files must have got corrupted or had different chown/chmod settings that were causing issues!!
Can someone tell me whether you should be able to execute php files from within the assets folder or not ?
-
☆ A M B ☆
- 24,524 Posts
That probably depends on your server’s configuration.
I always use MODx resources for my AJAX processors; just use a resource with no template and no content except the snippet with the php code. No worries about loose-cannon .php files hanging around waiting to get hacked, no permission problems, and immediate full access to the MODx API and the database.
Thanks Susan,
I had thought of trying that but was unsure about how to:
a. Call the resource in the JS and
b. The PHP script uses a require(’xxx.php’)
Can the require be done in the same manner as a snippet and then called as one ?
Regards,
Mark
-
☆ A M B ☆
- 24,524 Posts
1. Just use mypage.html where you specify the URL for the AJAX request.
2. sure. You can require other files from a snippet all you like. In fact, many snippets are really nothing more than some basic initialization then a require of the main code stored in a .php file.
-
☆ A M B ☆
- 24,524 Posts
I know next to nothing about Revo or its add-ons. AJAX is pretty generic, though. Neither Revo nor Evo much care about the javascript stuff you do in the front-end.