How do I send a score/variable to the site?

Get help using Construct 2

Post » Fri Mar 20, 2015 1:58 pm

Hi there! I need help with this;
I need to send scores (number variables) to some destination on a site im working for, preferably more than one variable if possible (so i can also send the timer variable) and some kind of hash to make sure its legit when they send their score. Thank you!

EDIT: I know i need to use ajax i just need to know what code line to send using it.
Last edited by itspayapai on Sat Mar 21, 2015 6:28 pm, edited 1 time in total.
B
4
Posts: 16
Reputation: 234

Post » Fri Mar 20, 2015 3:07 pm

Ajax ?
Who dares wins
B
56
S
15
G
16
Posts: 1,837
Reputation: 16,775

Post » Sat Mar 21, 2015 6:27 pm

@lennaert oh sorry, i already know to use ajax! i meant to say i need help with WHAT code/script i should sent to the site using ajax.
B
4
Posts: 16
Reputation: 234

Post » Sat Mar 21, 2015 6:47 pm

Likely by an Ajax post action ....

c2 vars: PlayerID, PlayerScore, TimePlayed,Code
Server post vars: id,playerscore,playertime,checkcode

In your data you will have something like "id="&PlayerID&"&playerscore="&PlayerScore&"&playertime="&TimePlayed&"&checkcode="&Code
You can encode bits as you like and need.


As for the server side, you will have to catch the post and store it somewhere.
Who dares wins
B
56
S
15
G
16
Posts: 1,837
Reputation: 16,775

Post » Sat Mar 21, 2015 8:08 pm

@lennaert thank you very much!
B
4
Posts: 16
Reputation: 234


Return to How do I....?

Who is online

Users browsing this forum: Masked Misery and 10 guests