"http_post_string" not working when running HTML?

tonyfinale

Member
In GMS2 I am trying to use the code "http_post_string" to upload high score data onto GMScoreboard.com, and though the code work fine and succeeds when I run the game as a Windows export, when I try to test the game in HTML I get no such results. It isn't even an error that appears; nothing happens at all.

Does this exact code not work quite the same in HTML? Or am I doing something foolish and missing something here.

I COULD use "url_open" instead which opens an entire new window that uploads the string and updates the leaderboard, but I'd prefer to avoid that method if possible.
 

TsukaYuriko

☄️
Forum Staff
Moderator
From the manual:
NOTE: You should be aware that due to XSS protection in browsers, requests to and attempts to load resources from across domains are blocked and may appear to return blank results. Please see the section on Cross Domain Issues for further details.

Have you investigated whether this could be the cause yet? Are the game and high scores separated? If so, this might be a good starting point.
 

FrostyCat

Redemption Seeker
GMScoreboard has had this issue for years, and their maintainers have entirely abdicated themselves. They could have added 1 line to their PHP code to make it work from HTML5 again, but they didn't even bother with that. Learn to make your own scoreboard or use another vendor.
 
  • Like
Reactions: Roa

tonyfinale

Member
This was also tots a duplicate post to already existing ones, but thanks much for putting up with me anyway gm fam. If I can't figure out this XSS stuff or come up with my own scoreboard I may just bite it and make uploading scores a downloaded version exclusive to my game or something.
 

AetherBones

Member
You need to use http_get function to interact with gmscoreboard.com, If this doesn't work with html5, sorry. I have not tested as I don't have the web export module for game maker. The new gmscoreboard server should work, cors is setup properly. If someone would like to test using the market place project in html5, I would appreciate it. (avoiding the new monthly pricing as long as I can)

I have a new gmscoreboard example project on the marketplace with a tutorial here: https://forum.yoyogames.com/index.php?threads/easy-online-highscores.89533/
 
Last edited:
Top