Load MySql PHP data on Ionic with Wamp64

1

I have installed and configured the Wamp64 server and I have managed to load the localhost and phpadmin without any problems. It also accesses projects from localhost, opening the root folder of them and the green symbol is displayed.

I created the entire Ionic project inside the wamp64 / www / project_name folder. The php files and the database created with phpmyAdmin are also stored within the project.

If I run localhost / my_project / data.php , I upload the json data without problem, but when executing ionic serve , load the title on the screen but the table is empty.

I created several different projects and all fail in the same. The json is read in the browser but does not load the data.php data when compiling Ionic . I can not think of what to do anymore: (

The last test example is this: link

Thank you very much !!!

    
asked by Maje 28.10.2018 в 00:45
source

1 answer

0

In case someone else happens ... in the headers of the .php files we must add the following:

header ('Access-Control-Allow-Origin: *'); header ('Access-Control-Allow-Methods: GET, POST, OPTIONS, DELETE, PUT'); header ('Access-Control-Allow-Headers: Authorization, Content-Type');

Now they load the data in duplicate but they charge !! A thousand thanks for reading and for this forum that makes our lives easier;)

    
answered by 28.10.2018 в 11:22