I’ve been working with PHP for a few months now. I’ve put together a small PHP site with three groups of users: admin, teacher, students.
Here’s what I would like to do:
Students are in different groups. I have five different groups now. Each one of these five groups has access to a link that directs them to an online classroom. We can have a variable number of classrooms.
Let’s say we have five classrooms for Group 1.
Let’s say that 20 students from Group 1 click on a link at 5:00p.m. This link brings them to an online classroom. I would like the first five students to be redirected to one classroom/link, the second five students redirected to another classroom/link, the third five students redirected to another classroom and so on.
My questions is, would it be best to do this in PHP? JavaScript? Is this overly complicated or actually quite trivial?
Cheers!
Sam
This is best to be done in the server side. Give them all the same link. On the page / PHP file behind the link hold a counter which counts the times that the link is requested. Based on the count, redirect to the desired page using the
locationheader.