title: connecting eclipse to PHP,MYSQL log in and register
body: <p>i wonder why i cant connect my application to my PHP,SQL Wamp server. here is my code, is this a problem of compatibility in my WAMP server? when the application starts to connect to server it force close. can any one help thanks!</p>
  
  <p>also one question how can i make this application online that can log in on the app. in cellphone and connect to my wampserver on my PC. which IP should i use? i've tried using <a href="http://192.168.MY-IPADDRESS/learn2crack_login_api" rel="nofollow">http://192.168.MY-IPADDRESS/learn2crack_login_api</a> but it doesnt work. thank you in advance for your answers !</p>
  
  <pre><code>private JSONParser jsonParser;
  
  //URL of the PHP API
  private static String loginURL = "http://10.0.2.2/learn2crack_login_api/";
  private static String registerURL = "http://10.0.2.2/learn2crack_login_api/";
  private static String forpassURL = "http://10.0.2.2/learn2crack_login_api/";
  private static String chgpassURL = "http://10.0.2.2/learn2crack_login_api/";
  
  
  private static String login_tag = "login";
  private static String register_tag = "register";
  private static String forpass_tag = "forpass";
  private static String chgpass_tag = "chgpass";
  
  
  // constructor
  public UserFunctions(){
      jsonParser = new JSONParser();
  }
  
  /**
   * Function to Login
   **/
  
  public JSONObject loginUser(String email, String password){
      // Building Parameters
      List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
      params.add(new BasicNameValuePair("tag", login_tag));
      params.add(new BasicNameValuePair("email", email));
      params.add(new BasicNameValuePair("password", password));
      JSONObject json = jsonParser.getJSONFromUrl(loginURL, params);
      return json;
  }
  
  /**
   * Function to change password
   **/
  
  public JSONObject chgPass(String newpas, String email){
      List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
      params.add(new BasicNameValuePair("tag", chgpass_tag));
  
      params.add(new BasicNameValuePair("newpas", newpas));
      params.add(new BasicNameValuePair("email", email));
      JSONObject json = jsonParser.getJSONFromUrl(chgpassURL, params);
      return json;
  }
  
  
  
  
  
  /**
   * Function to reset the password
   **/
  
  public JSONObject forPass(String forgotpassword){
      List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
      params.add(new BasicNameValuePair("tag", forpass_tag));
      params.add(new BasicNameValuePair("forgotpassword", forgotpassword));
      JSONObject json = jsonParser.getJSONFromUrl(forpassURL, params);
      return json;
  }
  
  
  
  
  
  
   /**
    * Function to  Register
    **/
  public JSONObject registerUser(String fname, String lname, String email, String uname, String password){
      // Building Parameters
      List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
      params.add(new BasicNameValuePair("tag", register_tag));
      params.add(new BasicNameValuePair("fname", fname));
      params.add(new BasicNameValuePair("lname", lname));
      params.add(new BasicNameValuePair("email", email));
      params.add(new BasicNameValuePair("uname", uname));
      params.add(new BasicNameValuePair("password", password));
      JSONObject json = jsonParser.getJSONFromUrl(registerURL,params);
      return json;
  }
  
  
  /**
   * Function to logout user
   * Resets the temporary data stored in SQLite Database
   * */
  public boolean logoutUser(Context context){
      DatabaseHandler db = new DatabaseHandler(context);
      db.resetTables();
      return true;
  }
  </code></pre>
  
  <p>}</p>