Text highlighting

I want to highlight some text in a page (with a color selected from the color pane) and store it in database so that on next visit to the page the highlighted text appears again. Any idea how can I implement this.

“On next visit to the page”. By whom? Same person, same session? Anyone? What happens when someone overwrites the hilighting?

lets consider there is only a single visitor. Not in same session and that’s why i want to store the highlighted text in database.

  1. user logs in
  2. highlight text which is stored in db
  3. user logs out
  4. same user logs in again and see the highlighted text that he did earlier.

Personally, if i were going to do this, it’d be a Javascript heavy setup, perhaps periodic AJAX calls to store the data (drafting), a save button to hard-save, (also hardsave on Logout). There would be little PHP actually involved except to 1) Initial display data, and 2) the AJAX receiver, which would just take the text sent and store it.