The Tomcat server that hosted mode runs doesn't run the file through the PHP preprocessor so all you get back is the text, just like any other file.
If you don't actually need to test the PHP, just put the required response text in the php file, otherwise search this list, there has been a recent thread on how to run PHP in hosted mode. Ian http://examples.roughian.com 2008/10/1 RamI <[EMAIL PROTECTED]> > > Hi all, > > I am trying to use JSON to get data from a php server. Here is my > code : > > String url = > "authenticate.php?name=\'"+name"\'&pwd=\'"+pass+"\'"; > System.out.println(url); > RequestBuilder requestBuilder = new > RequestBuilder( RequestBuilder.GET, url ); > try { > requestBuilder.sendRequest( null, new > RequestCallback(){ > public void onError(Request request, > Throwable exception) { > System.out.println("Unable to make > the query "+ request); > } > public void onResponseReceived(Request > request, Response > response){ > > System.out.println(response.getText()); > final JSONValue jsVal = > JSONParser.parse(response.getText()); > final JSONArray jsonNews = > jsVal.isObject().get("item").isArray(); > > > if(!jsonNews.isArray().get(0).isObject().equals(null)){ > this.init(); > }else{ > Window.alert("error"); > } > } > } ); > } catch (RequestException e) { > System.out.println(e.toString()); > } > > My problem is, I have my complete php script as "response" when > onResponseReceived(...) is fired. > However, when I paste the url that I get in the console, the result is > exactly what I want : > {"item":[{"name":"usernameTest"}]} > > Any idea ? > I am using gwt1.5.2 with a jre 1.6 > > Thanks > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
