Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I mark a user's progress when they're taking a multi-step action on my website?

Tags:

php

mysql

I need some implementation like they do in websites like Khanacademy or Edx-- when you log back in, they tell you, "You were currently in this section, continue from here?"

The only way I can think of doing this is having a column in database and have a form for each and every section (like lesson 1, lesson 2, lesson 3) and whenever the user clicks in the section, the form gets submitted and it updates the column in the database to remember. Will this approach work or there's a better way of doing this?

like image 870
Always Learning Forever Avatar asked Oct 21 '22 07:10

Always Learning Forever


1 Answers

You don't need to submit a form.

Personally, I have in my "foot.php"-like code that updates the users table with lastseen=now(), lastpage=:current_page and this allows me to not only know what they were doing last, but also when they were doing it, so I can construct a Users Online page which shares this information.

Of course, applications vary, but the general idea is usable anywhere.

like image 109
Niet the Dark Absol Avatar answered Oct 23 '22 11:10

Niet the Dark Absol