-1

I printed the result in logcat so I get

You don't have permission to access localhost on this server.... the php Script is working perfectly.

How can I access this Script... plz help me

Here's my cord

    public void getData() {
        String result ="";
        InputStream isr = null;
        try {
            HttpClient httpclient = new DefaultHttpClient();
            HttpPost post = new HttpPost("http://10.224.217.67/Parking/places.php");
            HttpResponse repons = httpclient.execute(post);
            HttpEntity enty = repons.getEntity();
            isr=enty.getContent();

            Log.d("http", "ok");
        } catch (Exception e) {
            Log.d("Error", "http error");
            viewrest.setText("Connection lost");
        }

        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(isr,"UTF-8"));
            StringBuilder sb = new StringBuilder();
            String line = null;
                while ((line = reader.readLine()) != null) {
                    sb.append(line+"\n");
                }
                isr.close();
                result=sb.toString();
                Log.d("result", result);
        } catch (Exception e) {
            Log.d("Error", "converting Error");
        }


        try {
            JSONArray jArray =  new JSONArray(result);  
            String s="";
            for (int i = 0; i < jArray.length(); i++) {
                JSONObject json = jArray.getJSONObject(i);  
                s =s+"PlaceId :"+json.getInt("PlaceId")+"\n";
            }
            viewrest.setText(s);

        } catch (Exception e) {
            Log.d("Error", "Errof"+e.toString());
        }
    }
  • See this link for ur error http://stackoverflow.com/questions/8366976/wamp-error-forbidden-you-dont-have-permission-to-access-phpmyadmin-on-this-s – Arun Dec 16 '13 at 16:51

2 Answers2

0

Try this:

Open httpd.conf file and find this part:

<Directory "c:/wamp/www/">
    Options Indexes FollowSymLinks
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

And change it like this:

<Directory "c:/wamp/www/">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>

Then open phpmyadmin.conf, find this

<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1
</Directory>

and change like it like this:

<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>

it worked for me. Hope it helps

MikeKeepsOnShine
  • 1,730
  • 4
  • 23
  • 35
-1

Change your URL with this URL "10.0.2.2/Parking/places.php"