How to create igoogle layout(drag & drop & store) using PHP and AJAX?

Peter picture Peter · May 4, 2009 · Viewed 9.9k times · Source

In igoogle, we can drag & drop the modules and then if we quit the browser and open it again, the position of each module still the same. I have tested couple of things:

  1. When not logged in, igoogle store the modules position in my cookies(cache). Because if I clear cache, it goes back to original position.

  2. When I logged in, after positioning the modules, even I logout and clear my cache, if I login again, the modules still the same, not back to original position.

What i want to ask:

  1. How to store the modules position for logged and not logged in user?

  2. Whar are the required skills? (I use php, mysql and jquery)

  3. Is there any good tutorials I can reference to?

Answer

superUntitled picture superUntitled · May 4, 2009

There is a very good tutorial here: http://nettuts.com/tutorials/javascript-ajax/inettuts/

You will have to store the users data in a mysql table. Maybe set up a "column / row" column in your mysql table with a linked content id. If you do not have any knowledge of relational databases, it would be a good idea to start there. If you do understand the db fundamentals, then it would be a simple update query to store the users info based on a cookie that is set to expire far into the future.

If you allow users to log in (like google), then the use of cookies is not necessary (but can still be useful), as you can use the div position data that is stored in your mysql table.