How do add variables in the browser redirect

0 favourites
  • 3 posts
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • When a user goes to a page where the game are to be played he gets an unique ID that I save in a hidden field.

    When the game is finished I would like to redirect the browser to another page. Something like this:

    ..../GameSummary?UniqueID=23123123123&score=434

    I need to be able to:

    1. Get the unique ID that is in the web page

    2. Get the score that are in the game

    Thank you

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • For the redirection you should be able to use the browser built-in plugin and its "Go to url" action.

    You can concatenate strings and global variables.

    Ex: "..../GameSummary?UniqueID=" & UniqueIDValue & "&score=" & Score

    Where UniqueIDValue and Score are both global variables.

    There's no "official" way to get the value of an hidden field in the page (but you could use a third-part plugin to retrieve it and store it in the UniqueIDValue global variable).

    You could also use the Browser's plugin action "QueryParam" and/or "QueryString" to retrieve values directly from the URL.

    I hope this helps.

  • Thank you. I sure have to look into this a little more. I got it to work using the browser plugin. But posting score like this will result in my game beeing really easy to cheat in.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)