Seems like all data is uploaded right in my site…
In my home’s PC all is ok, but in epizy I get this error:
www.bodyandmind.epizy.com/:1 Access to XMLHttpRequest at … (redirected from …) from origin ‘http://www.bodyandmind.epizy.com’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: The ‘Access-Control-Allow-Origin’ header has a value ‘…infinityfree…’ that is not equal to the supplied origin.
My site is only for manage a clients database for my personal working.
I use AJAX and a file to redirect between menu choises.
I access nothing outside this little site, it’s only for have a clients database and manage data from their problems at my work…
Nothing illegal nor out the site…
I don’t understand this block, there’s nothing bad with the site…
Please ignore everything that has been said so far, it’s completely irrelevant to your site. It’s a common error that often gets parroted, regardless of how wrong it’s been proven time and time again.
It’s a common mistake that all CORS errors are related to the browser validation system. But that only applies if you’re trying to embed things FROM your site INTO other sites.
If you get a CORS error without any cross site stuff, then the problem is something else. This is not a secret, just documented behavior that everyone seems to ignore. Please see the section " Why do I get a CORS error on the 404 error page" in this article for a bit more information:
In your particular case, it’s not a 404 error, but a 403 error. And looking at the Network tab in my browser, I see that this error is generated by this URL:
The reason of this is that the folder includes is not web accessible on our hosting. I don’t know exactly when or why this was done, but the gist is that the includes folder should only be used for PHP scripts that are PHP included into other scripts on your site.
So fixing this is simple: just move that script, and any other script that’s supposed to be accessed by browsers, out of that folder. If you put it in the base folder of your website, or in another folder (like actions), you’ll be able to access it without any problems.
I’d be happy to check, but it seems like the entire htdocs folder of your site is gone now.
Please make sure to move the funcs.php to the htdocs folder of your site then, not the home folder of your account.
And your code will work fine here as well. The key difference between your home and our servers is the security restrictions on using includes as a folder name. So as long as you put your web accessible files in a folder called anything other than includes, I’m sure you’ll have no problems in making them work here.