CORS Policy blocked page

Yeah the code paths are definitely not correct.

The first screenshot shows Javascript code. if you want to use AJAX to communicate to your website, you’ll need to query the URLs where you website code is available as. Specifying the full path on the server isn’t going to work because where exactly on the server your files are stored only matters within the server.

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/

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.

But none of these things are going to fix your 403 error. As you can see in the article Redirected to InfinityFree 403 Forbidden page, the folder name modules is blocked on our server for security reasons.

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.