hi

i'm trying to create an application that sends information through a query string to a php page that stores the information in an sql database. when i run the application it brings no errors and displays the form at the end of the connection method but no data is saved to the database. Just to be sure, i run the same query string in my browser and the data was saved. Here is a sample of the code i used for the connection method.

String url = "http://127.0.0.1/CRM/save.php";

void POST(String url) throws IOException {
        HttpConnection connection = null;
        InputStream is = null;
        OutputStream os = null;
        StringBuffer stringBuffer = new StringBuffer();
		TextBox s;
		

        try {
          connection = (HttpConnection)Connector.open(url+"?type=0&cust="+f+"&qty="+h+"&ammnt="+k+"&mode="+g+"?id="+n);
          connection.setRequestMethod(HttpConnection.GET);
          connection.setRequestProperty("IF-Modified-Since","20 Jan 2001 16:19:14 GMT");
          connection.setRequestProperty("User-Agent","Profile/MIDP-2.0 Confirguration/CLDC-1.1");
          connection.setRequestProperty("Content-Language", "en-CA");
          connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
          os = connection.openOutputStream();
          is = connection.openDataInputStream();
          Info = new Form("Saved2");
		  s = new TextBox("Main", null, 256, TextField.ANY);
		  s.setString(g);
		  display.setCurrent(s);
		 
          
			
			
        } finally {
           if(is!= null) {
              is.close();
           }
           if(os != null) {
              os.close();
           }
           if(connection != null) { 
              connection.close();
           }
        }
		
    }

Does the caller method that calls method POST has catch block? What is output of stack trace there?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.