title: is restful meant for web services only OR for both web services AND web pages?
body: <p>I read a lot of Restful tutorials for PHP. </p>
  
  <p>(I don't want to go in depth into why I am not using RoR. It is due to the team being more familiar with PHP)</p>
  
  <p>Because we are planning for future expansion into having APIs i read that it is important to implement Restful web services.</p>
  
  <p>I have looked at tutorials such as </p>
  
  <p><a href="http://www.gen-x-design.com/archives/create-a-rest-api-with-php/" rel="nofollow noreferrer">http://www.gen-x-design.com/archives/create-a-rest-api-with-php/</a></p>
  
  <p>Apparently restful is meant for webservices.</p>
  
  <p>What about for webpages? can they be RESTFUL as well?</p>
  
  <p>if the answer is NO, please do not go beyond this line AND just tell me. Thank you.</p>
  
  <p>i know to make the urls look like RESTFUL urls is to simply use mod_rewrite. However, i am quite sure, restful architecture goes beyond just making the urls look nice.</p>
  
  <p>For eg, i have a list of items on a webpage called list.php . Each item has a delete link next to it. E.g., list.php?id=1&amp;deleteitem</p>
  
  <p>What happens is that when someone clicks on the list.php?id=1&amp;deleteitem link, of course i go back to the same list.php file and check for the param deleteitem in $_GET.</p>
  
  <p>If detected, i will then delete from database based on the param id in $_GET.</p>
  
  <p>After which i will redirect back to list.php WITHOUT any params.</p>
  
  <p>I am wondering, how do i make this whole flow RESTFUL? </p>
  
  <p>I am asking because in REST, to make delete something you need to use HTTP request method (DELETE).</p>
  
  <p>Clearly in my links they are all just simply <code>&lt;a href="list.php?id=1&amp;deleteitem"&gt;Delete&lt;/a&gt;</code></p>
  
  <p>Please enlighten me. </p>
  
  <p>My programming is not that strong and it would be good if the advice given can be as layman as possible.</p>
  
  <p>Thank you.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have 2 follow up questions.</p>
  
  <p>question 1) Since this is a list of items with paging, how would the URL look like if i want to make it RESTful?</p>
  
  <p>question 2) Since i am putting DELETE links next to every one of the items in the list, I understand now, i should use </p>
  
  <pre><code>&lt;form method="POST"&gt;
  &lt;input type=hidden name="_method" value="delete"&gt;
  &lt;input type="submit" &gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>instead.</p>
  
  <p>however the form should be posted to where? the item url? /items/{item-id}</p>
  
  <p>But i want to go back to this listing page displaying a success message AFTER successfully deleting the row in database.</p>
  
  <p>I also want to avoid a popup message when i refresh this listing page with success message.</p>
  
  <p>If i post back to this list.php url, then it is not RESTful yes? because i am told by the answers below that each item is a resource which needs its own url.</p>
  
  <p>Please enlighten me. Thank you.</p>