I am developing a cross platform application using cordova. I have to send data from a form in app to a database which is on the on a local server created using XAMPP. MY .php file is in htdocs in xampp. I have tried many different things but nothing worked, the problem seems to be with ajax url. What value is given in ajax url. Now, my database is on my laptop using xampp server.
1条回答 默认 最新
- weixin_33743248 2018-06-14 13:51关注
You should give webserver ip adresse and path to you'r PHP file.
Don't forget you will test from an Android or IOS apps and so there havent access to localhost.
So if you'r PHP file path is : localhost/hello.php you have to check you'r ip adress (cmd -> ipconfig) and then use this url on you'r ajax request : 192.168.XXX.XXX/hello.php
解决 无用评论 打赏 举报