How to pass a value using httppost?
===

am working on this code to post a value say name of a person into a web page but due to some reason it not working... to some extend it is working i have given some print sequence in code which gets displayed in logcat....

this is my mainactivity 
   
    public class MainActivity extends Activity {
    String link="http://myweb.com/index.php";
    String name1 = "akhil";
    String value="name"+name1;
    Button bttn1;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        bttn1 = (Button)findViewById(R.id.bttn1);
        bttn1.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				try{
				post_connection obj = new post_connection();
				obj.connect(link,value);				
				}
				catch (Exception e) {
					// TODO: handle exception
					Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG).show();
				}
			}
		});        
     
    }   
}

my postconnection class is given below
    
    public class post_connection {
	
	public void connect(String link , String value)
	{
		
		try
		{
			URLConnection url = new URL(link).openConnection();
			if(url instanceof HttpURLConnection) {
				
				
				  // do stuff
				 
				System.out.println("@@@3");
				System.out.println("@@@3");
							
				System.out.println("@@@32");
				((HttpURLConnection) url).setRequestMethod("POST");
				((HttpURLConnection) url).setAllowUserInteraction(true);
				((HttpURLConnection) url).setDoInput(true);
				((HttpURLConnection) url).setDoOutput(true);
				((HttpURLConnection) url).setUseCaches(true);
				System.out.println("@@@4");
				System.out.println("Making the request");
				((HttpURLConnection)url).connect();
				System.out.println("connecting.....");
				
				DataOutputStream data = new DataOutputStream(((HttpURLConnection) url).getOutputStream());
				data.writeBytes(value);
				BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(((HttpURLConnection) url).getInputStream()));
				System.out.println("@@@5");
				String decodedString;
				while((decodedString=bufferedReader.readLine())!=null)
				{
					System.out.println("decoded::"+decodedString);
				}
				bufferedReader.close();
				}
				else {
				  // error?
					System.out.println("@@@23");
				}
			
		}
		catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		
		
	}

}

 ![this shows a logcat output like this][1]


  [1]: http://i.stack.imgur.com/ndIMe.png