I am looking for a way to interpret data in a URL, server side.
Client side, I can control what the URL is, and I can programmatically produce Data for the URL, but I do not have direct access to the source code.
So ultimately, I am trying to build an online High Score system, for an offline game.
I have access to Azure and my dedicated LAMP server. I would like for my server to wait for a connections that use a URL something like “http://www.myappserver19002393859.com/HighScores?UserID=2fb44e3888?Score=25250”
I want to get the UserID & Score from the URL and then redirect to another page with the High Score Table…
Any suggestions?
(Edit: I can do anything server side, it is only client side where I have limitations.)
Use PHP’s
$_GETcollection. It contains the key/value pairs of a URI’s querystring.In the example you’ve given, it would look like this:
HighScoresHandler.php
Note that you would be advised to implement some form of MAC (Message Authentication Code) or some other system to verify that a score is real, otherwise there is nothing stopping anyone from submitting bogus scores using forged HTTP requests (this is why you sometimes see insanely high scores posted to online scoreboards).