title: How to implement RESTful service on web application?
body: <p>i searched a lot regarding the question in the title and I'm still not really sure what I'm supposed to do. I just heard of RESTful this morning and the more I read about it the more confused I get.</p>
  
  <p>A couple of weeks ago I was supposed to make an PHP/jQuery/AJAX web application that would basically be a simple todo list with multiple users. I learned a lot about ajax and jQuery(thanks to stackoverflow) during the process and I am quite happy with the final result.</p>
  
  <p>The application works like this:
  The user logs in, and his id is stored in session variable. For example if he clicks on 'Add' button the code looks something like this.</p>
  
  <pre><code>//script.js
  $.get("ajax.php",{'action':'new','text': $text, 'list': $selectedList
      },
              function(msg){
                      // add a new task and fade it
                          $(msg).hide().appendTo('.listoftasks').fadeIn();
      });
  </code></pre>
  
  <p>And on the ajax.php</p>
  
  <blockquote>
  <pre><code>//ajax.php
  
   if($_GET['action'] == 'new')
      add_task($_GET['text'], $_GET['list'], $_SESSION['user_id']);
  </code></pre>
  </blockquote>
  
  <p>So, as it turns out an android app for the web app is in the plans and I was asked if I could make a RESTful web service for it. Can anybody point me in the right direction, is it possible to implement that kind of service with an application coded like this because I've read somewhere (among many other things) that it doesn't work with sessions?</p>
  
  <p>It would be great if someone coud at least point me to some basic tutorials, because at this moment this is all very confusing for me.</p>
  
  <p>Thank you for all your help</p>
  
  <p>edit:</p>
  
  <p>Ok thanks everyone, i managed to do what was asked from me with you help and I learned something new, thank you. The problem I have now is authentication. Basically the android app sends request to my api.php page with some variables (id, list_id etc). Now how do I implement some form of authentication so the api.php would only return results for the authenticated user. I've talked to the app developer briefly and basically he would send me username and password through http header (or something like that). How do I get those values on my api.php page?
  Thank you for all the help :)</p>