makingtheimpact's Forum Posts

  • 7 posts
  • Thank you nettemple and Fengist! I greatly appreciate your help in trying to solve this problem. And many thanks for the code samples and examples as that helps a lot!

    I'm working on trying to create the form inside Construct and posting the data to the database via AJAX, as that does indeed seem the only way to do it.

    Thank you again!!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Oh ok, that would help a lot. I really appreciate it! Thank you!

  • 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.

  • Oooooh... That helps a lot! I'll try that! Thank you!! This has been driving me crazy for what feels like forever!

  • Hi Newt, thanks for the suggestion. I was hoping not to have to use AJAX because I'm not super familiar with it and it would involve rewriting a lot of code that I already have done and I really don't have time for that.

    I really just want to pass the variables through the URL because that's what it's set up to do right now. I know it can work and it has before, but not reliably for some reason.

    I did a test yesterday and it started working though I don't know what I did. I have to test it a lot more to see if it's still doing it.

  • Hi guys, I am still a newb with Construct, but I've put together a math game which you can see here: play.mathfactsmatter.com

    It is supposed to let the user submit their score to a high score chart that I have built using PHP, MySQL, and WordPress.

    I have the game generate a series of variables that it puts in the URL. The special page I made then takes it and stores it in the database and presents a form to collect their information, but the problem is that the browser seems to be blocking the URL without giving any sort of warnings or anything.

    What happens is you go through, play the game, then click the button to submit your score. It is supposed to go to a special form I have made outside of Construct 3 but on the same subdomain.

    What I'm finding it does in Chrome on both mobile and desktop is that it doesn't go to the URL and instead it just reloads the page or restarts the game losing the score information.

    I did a bunch of searching and found someone saying somewhere in the forum to create a form button and set the opacity to 0 over where they are supposed to click.

    I tested it on my phone in the DuckDuckGo browser and it worked fine but in Chrome it doesn't work. I haven't tested all the browsers yet, but Chrome is the most important one to work since it's the most widely used one.

    I have tried attaching different events to it individually and in an OR block. I've tried just having a click event on the button. So far no luck.

    Here's what I currently have it set to.

    Is there a way to get this thing to work?

  • I'm new to Construct, so please excuse my ignorance. Unfortunately I keep encountering various issues, then I solve it and encounter more.

    I have a button that mutes the sound and music in a game I'm building and I have a quit button that is next to it. The buttons are anchored at the top of the screen. They are not directly next to each other and they do not overlap.

    I have a touch "object event on the sound icon and a touch object event on the quit button. When I debug or preview the game and click on the sound button it thinks that I clicked on quit intermittently.

    The sound button toggles a boolean variable that controls the sound and the quit button resets all the global variables and returns to the start screen.

    No matter what I try, it continues to do this. What am I doing wrong? I don't understand it and it's driving me crazy. I'm already way over due in delivering this and I'm encountering problems like this that make no sense. Any help is greatly appreciated.

    Here's a link to the current file..

    https://www.dropbox.com/s/d14t42zzn48s4j9/SpaceChallenge.c3p?dl=0

  • 7 posts