A
A
Alexey Noir2019-04-02 16:59:27
CORS
Alexey Noir, 2019-04-02 16:59:27

The server.php file is not downloaded when submitting data via a form to the server?

Hello!
Created a server using Open Server, uploaded the site. When trying to send data through a form, in Chrome and Opera, such an error in the console:
5ca366de26c2d704148119.jpegAccess to XMLHttpRequest at 'file:///D:/Open%20Server/OSPanel/domains/test.org/server.php' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

Chrome Canary same + error:
POST file:///D:/Open%20Server/OSPanel/domains/test.org/server.php net::ERR_FAILED
5ca36732d7cb3767760107.jpeg
In Network tab (Chrome Canary only):
5ca367a7ed672666361676.jpeg
On Stack Overflow wrote that this occurs due to CORS Policy and advised to disable it with the --disable-web-security --user-data-dir flag. Put a flag - does not work. There are no errors in the code, I checked it 10 times.
Is there anything else I can do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Kotov, 2019-04-02
@liqrizz

Try to specify http:// 127.0.0.1/test.org/server.php/ or whatever it is in the open server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question