Ionic框架和php mysql [英] Ionic framework and php mysql

查看:1764
本文介绍了Ionic框架和php mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ionic的新用户,Apahce Cordova和我创建了一个简单的应用程序,它有静态列表视图项,但我想从MYSQL表中获取数据,并将其替换在我的静态列表中。我的Google它有一些工作,但我不知道应该放在我的php文件,我创建了一些php文件在Ionic app / www / php文件,但它不工作,我和你的解决方案是什么?谢谢

I am new in Ionic,Apahce Cordova and I created a simple application which has static list view items but I want to get data from MYSQL table and replace this in my static list. I Google it some one worked on it but I don't know where I should put my php files and I created some php files in Ionic app/www/php files but it doesn't work for me and what is your solution guys? Thank you

推荐答案

你可以把你的php文件在localhost或live server.I有同样的问题)当应用程序在浏览器中运行。这是我体验的解决方案

You can put your php files in localhost or live server.I had the same problem (Cross-Origin Request Blocked) when the app is run in browser.Here are solutions from my experience

1.在模拟器中不在浏览器中测试应用程序,并将localhost地址更改为 http://10.0.2.2/test/test.php 。这将正常工作

1.Test the app in emulator not in browser and change the localhost address to this http://10.0.2.2/test/test.php.This will works fine for me

运行在Android设备,你无法从本地主机访问,所以将文件放在活动服务器
例如: http://www.testapp.in/test/test.php

2.if you are run in android device you cant access from the localhost,so put the files in a live server eg:http://www.testapp.in/test/test.php

这篇关于Ionic框架和php mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆