Page 1 of 1

modules: how to run a separate PHP file?

Posted: 18 July 2020, 13:38
by Idsky
I made a modules/maps/index.php file thinking I could load that in the browser directly with

Code: Select all

window.open(g_gamethemeurl+"modules/maps/");
But that gives a 403 permission error. I understand that will be for security (though my page takes no input).

This maps reference page is big, I want to open it in a new tab, not in an overlay on the game page. Suggestions?

Re: modules: how to run a separate PHP file?

Posted: 18 July 2020, 16:38
by Lunalol
Hi

PHP files are on SERVER side
Your browser is on CLIENT side
you can only import JS, CSS on CLIENT side
you can only import a PHP file from PHP itself on SERVER side.

Hope it helps.

Re: modules: how to run a separate PHP file?

Posted: 18 July 2020, 18:31
by Tisaac
Idsky wrote: 18 July 2020, 13:38 I made a modules/maps/index.php file thinking I could load that in the browser directly with

Code: Select all

window.open(g_gamethemeurl+"modules/maps/");
But that gives a 403 permission error. I understand that will be for security (though my page takes no input).

This maps reference page is big, I want to open it in a new tab, not in an overlay on the game page. Suggestions?
For security reasons, I dont think you could do something like this. I would believe only the standard action urls are authorized.
Lets wait to see if an admin has a solution, but I wouldnt be surprised if this is not possible.

Re: modules: how to run a separate PHP file?

Posted: 19 July 2020, 10:00
by Idsky
Static html pages within modules can be loaded so I'll pre-render / compile this page offline and add it as html.
Looks like the modules folder is not added to the repository on Quantum though, I guess an admin will need to add that for me.

Re: modules: how to run a separate PHP file?

Posted: 23 July 2020, 03:38
by Idsky
What I did was put a static html file into the img folder, along with a spritesheet for it's images, which was set as this.dontPreloadImage in the javascript constructor function.

I have a PHP script in misc for 'compiling' this static page which I run offline and commit the result.