0

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();
           }
        }
		
    }
2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by peter_budo
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.