How to make highscore data post using construct 2

Discuss game development design and post your game ideas

Post » Fri Sep 23, 2016 4:31 am

Hi all,

I am trying to do highscore in construct2. I have to call this code from construct 2

function submitscore(score)
{
var submit_url = document.referrer + 'index.php?act=Arcade&do=newscore';
if (score == ''){score = 0;}
document.write('<form name="highscore" action="'+submit_url+'" method="POST" target="_parent"><input type="hidden" name="gscore" value="'+score+'"></form>');

}

Please let me know how to post values to index.php file. the sample link must be like this,
index.php?act=Arcade&do=newscore?hscore=0&gname=AbovecloudsHS2

Help will be greatful.

Thanks.
B
5
Posts: 4
Reputation: 233

Post » Fri Sep 23, 2016 7:14 am

Use the provided AJAX plugin instead of the JS function you mention.
Check the How do I FAQ in the section AJAX for actual examples of use of what you are asking.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,785


Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 0 guests