Suraj Malinga
Suraj Malinga

Reputation: 101

How to pass actionScript 2 value to php

I have decompiled a flash game. There is a variable called totalscore. I need to send this variable to my leaderboard.php. How can I do this in secure.

Currently I'm passing the value like this.

getURL("mydomain.com/leaderboard.php&value="+totalscore,'_top','get');

I have accessed above value like this:

leaderboard.php

$totalscore = $_GET['value'];

But this method is not secure. Because any one can change the value an press enter. then value of 'value' will store in the db.

I tried using POST METHOD on actionscript. But it not worked.

Please help me to solve this problem?

Upvotes: 1

Views: 2229

Answers (1)

Marty
Marty

Reputation: 39456

You can use LoadVars which has send() and sendAndLoad() methods.

The third argument of both of these lets you determine the method you want to use to send the data (GET or POST). Example:

var vars:LoadVars = new LoadVars();
vars.value = totalScore;
vars.send("mydomain.com/leaderboard.php", "_blank", "POST");

Upvotes: 1

Related Questions