How get url param and save to variable ?

Discussion and feedback on Construct 2

Post » Mon Sep 18, 2017 12:20 pm

Message: A2D can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hi
This is my url : http://game.com/game/?user=103&name=ali
I want on load game, 'user' and 'name' variable save to construct and show to user
Simple :

Hi 'Ali', your user ID is 103

How can ?
Thank you
B
5
Posts: 10
Reputation: 245

Post » Mon Sep 18, 2017 1:16 pm

ImageImageImage
B
71
S
22
G
248
Posts: 3,758
Reputation: 138,067

Post » Mon Sep 18, 2017 2:13 pm

How use queryparam ?
I dont undetstand
B
5
Posts: 10
Reputation: 245

Post » Mon Sep 18, 2017 3:26 pm

QueryParam
Return a query string parameter by name. For example, if the URL ends with index.html?foo=bar&baz=wan, QueryParam("foo") returns bar and QueryParam("baz") returns wan.
ImageImageImage
B
71
S
22
G
248
Posts: 3,758
Reputation: 138,067

Post » Mon Sep 18, 2017 4:20 pm

Ok thank you
But i dont how use it
Add new event ? in event sheet ?
B
5
Posts: 10
Reputation: 245

Post » Mon Sep 18, 2017 5:30 pm

Last edited by blackhornet on Mon Sep 18, 2017 6:16 pm, edited 1 time in total.
ImageImageImage
B
71
S
22
G
248
Posts: 3,758
Reputation: 138,067

Post » Mon Sep 18, 2017 6:12 pm

This is for 246 version
Can you send me 244 version ?
Thank you
B
5
Posts: 10
Reputation: 245

Post » Mon Sep 18, 2017 6:16 pm

I've updated the link.
ImageImageImage
B
71
S
22
G
248
Posts: 3,758
Reputation: 138,067

Post » Mon Sep 18, 2017 6:31 pm

Message: A2D can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Dear blackhornet, Thank you very much
I want add to variable
This image is correct ? http://s8.picofile.com/file/8306806792/var.JPG
B
5
Posts: 10
Reputation: 245

Post » Mon Sep 18, 2017 6:52 pm

No, the initial value can only be a constant. Add an action in On Start of layout, and use System.Set value to set it.
ImageImageImage
B
71
S
22
G
248
Posts: 3,758
Reputation: 138,067

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests