title: Webservice for mobile Application using REST Service in PHP
body: <p>I have to create a webservice for mobile application(IPhone and Android) in Rest Service. This Application is based one E-Publishing. I try some REST service based on SLIM . I can able to add a data into db and also retrieve the data from DB. </p>
  
  <p>I use the following link to develop REST Service</p>
  
  <pre><code>http://phpmaster.com/writing-a-restful-web-service-with-slim/
  </code></pre>
  
  <p>I am able to add a new data through form in html but i want to use url to add a data. but i cant. here is the code i used </p>
  
  <pre><code>&lt;form action="http://localhost/samples/Restfull/samp5/index.php/custom" method="POST"&gt;
   &lt;input type="hidden" name="_METHOD" value="POST"&gt;
   Name: &lt;input type="text" name="Customer_Name"&gt;&lt;br&gt;
   Mobile: &lt;input type="text" name="Customer_Mobile"&gt;&lt;br&gt;
   Email: &lt;input type="text" name="Customer_Email"&gt;&lt;br&gt;
   Address: &lt;textarea name="Customer_Address"&gt;&lt;/textarea&gt;
   &lt;br&gt;
   &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>When i try through this form , the operation is successfully done. But i want to make that as web service. I try to add data through url but failed, at the same time Delete or get data by using join queries also not working. </p>
  
  <p>I retrieve data from Db by using following function </p>
  
  <pre><code>$app-&gt;get("/custom/:id", function ($id) use ($app, $db) {
      $app-&gt;response()-&gt;header("Content-Type", "application/json");
      $custom = $db-&gt;Registration()-&gt;where("Registration_Id", $id);
      if ($data = $custom-&gt;fetch()) {
          echo json_encode(array(
              "custom_Name" =&gt; $data["Customer_Name"],
              "custom_Mobile" =&gt; $data["Customer_Mobile"],
              "custom_Email" =&gt; $data["Customer_Email"],
              "custom_Address" =&gt; $data["Customer_Address"]
              ));
      }
      else{
          echo json_encode(array(
              "status" =&gt; false,
              "message" =&gt; " $id does not exist"
              ));
      }
  });
  </code></pre>
  
  <p>This also works well.</p>
  
  <p>Is any other way or good samples available. Not only in Slim. I need to integrate REST Service. Please suggest on this.</p>
  
  <p>Thanks in advance. </p>