I’ve been trying to implement a page to show the movements of accounts after clicking on the corresponding row. I use $.when($.get) in orde to achieve that, but I always get this error message:
Access to XMLHttpRequest at 'https://errors.infinityfree.net/errors/403/' (redirected from 'http://makeups.epizy.com/home/vol6_1/epizy.com/epiz_33342457/htdocs/core/modules/ventas/view/movimientos/listas.php?cac=1') from origin 'http://makeups.epizy.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. jquery-1.10.2.js:6
GET https://errors.infinityfree.net/errors/403/ net::ERR_FAILED
Below you can see the code to retrieve the data and the code in listas.php that I’m using to prove the response.
Conversely, in the second screenshot, you could include files through the full path, including the home folder and document root of your account. In fact, by starting the include directive with a slash, you’re using an absolute path. But your website files aren’t stored in the /htdocs folder on the server, they are stored in /home/vol6_1/epizy.com/epiz_XXXXX/htdocs.
Having the absolute path in the document root in your code everywhere isn’t great for portability, so it’s more common to either use relative imports or specify a configuration variable somewhere that hold the document root. So you don’t need to edit every file in your project if you ever need to switch accounts or providers.
The code paths do give me the feeling you’re using a CMS (Joomla?), and having your frontend code talk directly to view files does not seem to me like it’s the correct way to add additional routes to a CMS.
And finally, if you want to share code, please just share the code. Making an image of the code with fancy editor window decorations looks cool but is pointless and means I’m not going able to show you how your code could work because I can’t easily copy it to make changes.
Checking the article, it doesn’t seem like “modules” is referenced somewhere, “includes” is. Perhaps it should be added, if it’s indeed blocked?
My test on https://thirdssltest.epizy.com/modules/ doesn’t seem to reflect that, though (also tried core/modules).