I'm trying to create a web application with 2 pages video page and picture page. After watch video user will be redirected to picture page The requirements are :
Video page show video on lists either sequential or random, total video played will be limited, ex: Video A only able to play 2 times, Video B only able to play 3 times, and so on.. if all limit is reached then limit will be reseted.
Picture page show picture corresponding with video
So it's like when user access this web
if user got video A -> got picture A
if user got video B -> got picture B
What i've thought:
*video and picture has same name.
Write video name list,limit, and current played on a txt(TXT_Video).
When user access video page program will check the limit (if current played < limit {...}) in the txt(TXT_Video) recursively to get name of video that will be played.
Program show video on video page then write video name to another txt(TXT_picture).
- Program get the picture name from (TXT_picture) and show picture to picture page.
Problem :
My problem is dealing with concurrency :
- User X got video A but didnt play it.
- User Y got Video B and play it. Then redirected to Picture B.
- User X play the video. Then redirected to Picture B which is wrong.
How can i deal with this problem without passing parameter on url?