title: How to make an online PHP point of sale (POS) system have offline capability?
body: <p>I have been working on a POS system in PHP/MySQL and if the customers internet goes down they lose all ability to sell their products.</p>
  
  <p>I will only need basic functionality while in "offline mode" for example selling a product I just need to record the price/qty and product id. </p>
  
  <p>It is possible for me to use the latest browsers so I have been researching HTML5 localStorage, which can store data into the browser session which will work fine if I use AJAX to record the transactions. </p>
  
  <p>But I am not sure exactly how to check that the internet has gone down, how to ensure the client can still see the webpage without getting an error/no connection screen, and how to implement the localStorage functionality to overwrite the regular functionality.</p>
  
  <p>If you can help or have a better way of dealing with this that will be excellent!</p>
  
  <p>Side note: I am considering moving to use this open source point of sale if that helps - <a href="http://sourceforge.net/projects/opensourcepos/?source=directory" rel="nofollow">http://sourceforge.net/projects/opensourcepos/?source=directory</a></p>
  
  <p>Thanks</p>
  
  <p>EDIT: Also the search function is used to find all products and is called using AJAX. Is there a way to store the product list (generated from MySQL) locally as well. I could populate a list of all products into the html but if the page is refreshed it will be lost.</p>