What do I wrong?

0 favourites
  • 7 posts
From the Asset Store
Be quick and choose whether the shown equation is right or wrong.
  • Hi,

    I know php/html, but I have never build a game before.

    So 4 weeks ago I found/bought Construct 2,

    from that moment I have read a lot of tutorials, because I want to learn how to make a game.

    I have bought some game kits and started my first game, a slot machine (Multi line)

    The game works with a MySQL database, and I tested it every time trough: Microsoft EDGE (localhost)

    When I click spin, database is successfully updated, so no problems.

    I think, Yes my first game! But it's only localhost until now.

    So I did export my game to html5 and uploaded the game to the server. And here is my problem.

    When I visited the link: http://sksdt.com/games/mafia-slot/

    -----------------------------

    • Microsoft EDGE (MySQL will not update, select is working!)
    • IE (Same as Microsoft EDGE)
    • Chroome (Same as Microsoft EDGE)
    • Safari (Same as Microsoft EDGE)
    • FireFox (Yes this works great!)

    So with this problem in my mind, I did a test with localhost

    I opened the preview every time inside a other browser.

    -----------------------------

    • Microsoft EDGE (Yes this works great!)
    • IE (MySQL will not update, select is working!)
    • Chroome (Same as IE)
    • Safari (Same as IE)
    • FireFox (Same as IE)

    Here is my capx file: http://sksdt.com/games/construct/slot-game.capx

    I can't find any similar problems on the net.

    Can someone tell me what I'am doing wrong? Or is it a bug?

  • without seeing the actual capx, it is more guessing.

    • is the php script located on the same domain? (Cross-Domain is restricted)

    Also, this exception is raised when running:

    Uncaught (in promise) DOMException: Only secure origins are allowed

  • Thx for your reply Ubivis

    The .capx is actuel, you can download here: http://sksdt.com/games/construct/slot-game.capx

    Live version is located at: http://sksdt.com/games/mafia-slot/

    Php is on same domain you can download here: http://sksdt.com/games/construct/database.rar

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thanks, no need to download the database script, I just wanted to be sure that the game and the script is on the same domain.

    Having a look into the capx and will come back in a few minutes.

  • sorry, can't see a mistake in the ajax events. to better know what happens, I would suggest to change the script in a way to return a status code to get sure that the ajax request is successfully triggered.

  • ok, the funny thing is it's working on Firefox but all other browsers wil not update the database. Anyway thx for your help

  • the game does to tell me, if something does not work (played it using Chrome), that's why I suggested to add a response to the server script and show it in the game.

    Back in the days, when I worked with PHP and MySQL (very long time ago), I always had something set up incorrectly in the database as I sent an ID as a string but wanted to save it as a integer. Mostly very dumb problems that were easily fixed, unfortunately I have not worked with MySQL for a couple of years now and feel myself not in the position to have a check on that part of the game. (fingers crossed, that someone else might be able to)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)