Php backend interfaces cannot cross domains

has been added to the php interface file:

header("Access-Control-Allow-Origin:*");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");

however, the front end still reports an error when calling the interface to request data:

Failed to load http://aaa.com/version?test=1: Redirect from "http://aaa.com/version?test=1" to "http://bbb.com" has been blocked by CORS policy: No "Access-Control-Allow-Origin" header is present on the requested resource. Origin "http://ccc.com" is therefore not allowed access.

clipboard.png

clipboard.png

Apr.03,2021

you can use callback to solve cross-domain problems at the front end


the Access-Control-Allow-Origin you set depends on whether your Response Headers has
some frames will override your settings

clipboard.png

also set
Access-Control-Allow-Method: GET POST OPTIONS PUT


you didn't even add header, * there is a space missing in front of you

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be98bf-3196d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be98bf-3196d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?