我正在使用Volley连接到MySql数据库.我创建了数据库表并编写了php函数,下面是java代码.所有这一切都在一直工作,但就在昨天它醒来在logcat中发出这个错误并且它没有返回任何响应,使用谷歌chrome postman测试php脚本工作得很好所以我认为我的java代码有问题.
BasicNetwork.performRequest:http://192.168.43.71/database/login.php的意外响应代码403
我知道之前曾经问过这样的几个问题,我已经完成了所有这些问题,似乎没有什么工作可做.我疯了.
private void login() { StringRequest jsonObjRequest = new StringRequest(Method.POST, Constants.ACCOUNTLOGIN, loginSuccessListener(), loginErrorListener()) { protected MapgetParams() throws com.android.volley.AuthFailureError { Map params = new HashMap (); params.put("user_phone_number", sPhoneNumber); params.put("user_password", sPassword); return params; }; }; mVolleyQueue.add(jsonObjRequest); }
小智.. 7
First check if you can open the same url on your mobile browser. I assume you use Apache2.4.9 webserver. If you've not changed default values for you get "denied permission". To solve this problem you need change some values in "httpd.conf" file which has Apache settings.
1- Under DocumentRoot change Directory xml tag as following:
AllowOverride none Require all granted
2- Under "onlineoffline tag" update the line as following:
... ... ... # onlineoffline tag - don't remove Require all granted
Note: If you use older version of Apache you need google for right syntax in httpd.conf
如果这种变化有效,请告诉我.:)
First check if you can open the same url on your mobile browser. I assume you use Apache2.4.9 webserver. If you've not changed default values for you get "denied permission". To solve this problem you need change some values in "httpd.conf" file which has Apache settings.
1- Under DocumentRoot change Directory xml tag as following:
AllowOverride none Require all granted
2- Under "onlineoffline tag" update the line as following:
... ... ... # onlineoffline tag - don't remove Require all granted
Note: If you use older version of Apache you need google for right syntax in httpd.conf
如果这种变化有效,请告诉我.:)