title: Sending and receiving data from php with android
body: <p>I have a php file, the class name is YoutubeToMp3.It has a function named as "get".It works truely.When i want to print it's result in server I do it like this 
  <code>echo YoutubeToMP3::get('https://www.youtube.com/watch?v=sEhy-RXkNo0', YoutubeToMP3::LINK);</code>
  The problem is i want to send data from android to php in server and call the function "get" with using sent data from android and send back the "get" function's return data to android.For example in android i send data named url.As below </p>
  
  <pre><code>public void postData(String toPost) {
  // Create a new HttpClient and Post Header
  
  HttpClient httpclient = new DefaultHttpClient();
  
  HttpPost httppost = new HttpPost("http://www.URL.com/yourpage.php");
  
  
  //This is the data to send
  
  String url = 'https://www.youtube.com/watch?v=sEhy-RXkNo0'; //any data to send
  
  
  
  try {
  
  // Add your data
  
  List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(1);
  
  nameValuePairs.add(new BasicNameValuePair("action", url));
  
  httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  
  // Execute HTTP Post Request
  
  ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();
  String response = httpclient.execute(httppost, responseHandler);
  
  //This is the response from a php application
  String reverseString = response;
  Toast.makeText(this, "response" + reverseString, Toast.LENGTH_LONG).show();
  
  } catch (ClientProtocolException e) {
  Toast.makeText(this, "CPE response " + e.toString(), Toast.LENGTH_LONG).show();
  // TODO Auto-generated catch block
  } catch (IOException e) {
  Toast.makeText(this, "IOE response " + e.toString(), Toast.LENGTH_LONG).show();
  // TODO Auto-generated catch block
  }
  
  }//end postData()
  </code></pre>
  
  <p>And i want to use function in server like this </p>
  
  <pre><code>YoutubeToMP3::get(url, YoutubeToMP3::LINK); 
  </code></pre>
  
  <p>Clearly i wanna tell you this: i sent data to server but in server how can i take this data and use it with get function and send back the data to android? 
  Thanks ind advance.
  Any help would be appreciated.
  Note: i want to run this php files in wordpress.</p>