How do add variables in the browser redirect

Get help using Construct 2

Post » Fri Jun 29, 2012 1:08 pm

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:


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
Posts: 9
Reputation: 618

Post » Fri Jun 29, 2012 2:49 pm

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.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Posts: 6,930
Reputation: 56,894

Post » Mon Jul 02, 2012 2:24 pm

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.
Posts: 9
Reputation: 618

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests