Connecting to a PHP web server with android
<p>Hi! I'm developing an internet based app in android. What i want to do is send a user id and password to a php web server and return a response from the server. The response could be a text, like "valid" or "invalid", and if the response is "valid" then a new activity should be launched. I don't know how to send data to a PHP server from android and read a response from the server. The following PHP code will generate a proper response. Please help me regarding this as it is important in my final year project of my BS in computer science. Thanks!</p>

<pre><code>&lt;?php
 $user= $_POST["uid"];
 $pwd=$_POST["pass"];
 $con= mysql_connect("localhost","root");
 if(!$con)
 {
     die("Not able to connect");

 }
 mysql_select_db("try",$con);
 $result=mysql_query("Select * from info where uid='$user'and pass='$pwd'");

 if( mysql_num_rows($result)&lt;=0)
 {
     echo "unsuccessful";
 }
 else
 {
     echo "successful";
 }
 mysql_close($con);
?&gt;
</code></pre>
