Ajax problems

0 favourites
  • 9 posts
  • I am using AJAX to make an online score that is hosted in a website with his Database(MySQL) and PHP files.

    Saving data is all correctly. The problem is that the load of the high-score it's not working.

    If I load the page in the browser the PHP file works but in the game is not.

    I found that someone got this problem too. scirra.com/forum/ajaxlastdata-problem_topic50114.html

    He solve it with adding "header('Access-Control-Allow-Origin: *');" on the PHP files but for me it's not working :(

    Here are my php files: mega.co.nz

    Here are the images of capx layout:

    imgur.com/a/qhOoA

    PS: English is not my mine language so if you don't understand something I will try to explain a bit better.

    Edit: Edited for better understanding. Added PHP files and images.

  • Edited and added info

  • I just tested with the local PHP files and it works fine.

    The problem seems to be just on the online PHP files.

    So the problem could be on my host?

    /*

    Joke Time

    Day 2: Talking to myself is not working if the mankind where alive this would be easier

    */

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I uploaded the game to the host too. Still not getting scores updates.

    I find a new thing. When I call the PHP with the browser. The first time I get the response is not working either but the second time goes fine.

    Help

    <img src="smileys/smiley19.gif" border="0" align="middle" />

  • Could be a caching issue, I saw this with Chrome.

    What browser are you using? If Chrome, try running in Icognito mode.

  • Yes I am using chrome. I tried with Icognito and is not working either.

    Here you can play the game and test what it's happening.

    Step 1

    Go to ayudaenaccion.org/wedu-juego/Ayudaenaccion/index.html

    Step 2

    Ranking now --> Menu--> Go to Tienda when you die-->Put in the textbox some name--> Ranking will not show the new saved score.

    Step 3

    Copy paste to your browser ayudaenaccion.org/wedu-juego/Ayudaenaccion/getscores.php

    The first time will not show anything. Do it again and your name and your score will appear.

    Reload the game again and the score will appear.

  • Works for me Peret. Maybe you've fixed it already but I died, entered the name "test" and it showed up right away.

  • I just tried in another Pc and as ramones said it works!

    On Monday I will try to test on the same PC and post if I had found a solution or is it just random magic.

    Thank you for the help! :) ramones

  • Okey I found the problem.

    The problem is that at work they use a Forefront TMG. I don't know it's this for sure but all the "awards" ara poiting to this. Also could be that I don't have Admin permision but most likely it's the ForeFront.

    Thank you everybody who lost a bit of their time to help me.

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