If you've ever built an HTML form and used a PHP script for the processing part, then you'll be used to the concepts of $_POST and $_GET. Also likely is that you are aware that it is possible to upload files to a server using a similar form and PHP combo . The questions is how do we successfully upload/send data created using JavaScript to a PHP script when it is more than a small snippet of data. JavaScript/jQuery Let's pretend we've saved a JSON string to localStorage and that we want to send this as a Blob to a PHP script. In our JavaScript, we could write: <!DOCTYPE html> <html> <head> // We'll import the jQuery library <script src="js/jquery.js"></script> </head> <body> // We've retrieved data in some way, perhaps using jQuery getJSON() $.getJSON("json.php", function(data) { // We've then added the data to Local Storage localStorage.setItem('json', JSON.stringi
Technology tips for writers, editors, designers, illustrators, programmers and publishers, and now Retro Gamers.