tags:

views:

48

answers:

1

Just like you would with a regular form using XHTML... can someone give me an example of sending a POST or GET request using PHP?

Like game.php?user=Dan&lvl=43&coins=54

and then the game.php page would do it's magic with the $_GET tag and do Mysql stuff. :P

Thanks,

+3  A: 

Using HttpClient:

List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("q", "httpclient"));
qparams.add(new BasicNameValuePair("btnG", "Google Search"));
qparams.add(new BasicNameValuePair("aq", "f"));
qparams.add(new BasicNameValuePair("oq", null));
URI uri = URIUtils.createURI("http", "www.google.com", -1, "/search", URLEncodedUtils.format(qparams, "UTF-8"), null);
HttpGet httpget = new HttpGet(uri);
System.out.println(httpget.getURI());
PartlyCloudy