Hmm.. well I tried it but it doesn't seem to do what I want it to do.
Here's what I added to my game..
I set the sprite button to do the AJAX call but it doesn't seem to do anything when I click on it. At least it's not refreshing the page, but it's also not even sending the data to the URL.
I probably did it wrong.. sorry I'm a newb at this, especially at AJAX.
But let me clarify.. I don't want to just send data to a URL, I actually want the user to go to the URL to fill out a form. I encode the data before sending it in the URL, then I have the page on the receiving end decode it and process it. I created several protections to prevent cheating and duplicates.. anyway...
The page I need it to go to is not just any page, it's a special form, it just happens to capture and save the user's score data that it gets via the URL.
Here's the page I'm trying to send the user to: play.mathfactsmatter.com/save_score.php
As soon as it loads it saves the score data to the database by pulling the data from the URL, decoding it, sanitizing it, and storing it under a long unique reference number.
Then it displays the form to get the user's name, etc. When they hit submit, then it adds the user's info to their record in the database.
From there it redirects them to another page on the primary domain where it looks up their teacher and sends an email to them.
So one of the crucial parts of this is getting the user from the game to that page.
To get it to work, I had read on another forum post that I can use a form button with the opacity set to 0 and that the user has to click on it for the URL to open.
So I did that and I did have it working at some point, but it was refreshing the page when the enter key was pressed (even though I didn't have any events attached to that) and the URL wasn't loading every single time.
I ended up changing some things trying to fix it and now it won't work at all and I don't know why.