I've encountered a small problem building a web application.
My thinking was simple: application [web music player] reads $_POST['itemId']
every time it is loaded. If it does not exist, the player doesn't start playing a song, but idles, otherwise it plays a song with itemId.
Now the problem comes here:
when a song in a playlist is finished, I'd like to refresh the page and send incremented itemId via post request, so the server side will know which song I'm currently listening to. I've searched the internet for possible solutions how to refresh a page and send post data at the same time, but all I've found are Ajax tutorials.
A working solution would be sending a form every time I'd like to load a new song, but it seems quite a messy one, so I'd like to know if anybody had done that before.