Ajax problems

Get help using Construct 2

Post » Mon May 20, 2013 9:53 am

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. http://www.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: https://mega.co.nz/#!Rs4kmIKB!I7JKcg4vtgf6QedE9H05TgBuCFhUIWmxh0Llut1GJBo

Here are the images of capx layout:
http://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.Peret2013-05-21 09:28:46
B
14
S
4
G
1
Posts: 42
Reputation: 1,775

Post » Tue May 21, 2013 9:29 am

Edited and added info
B
14
S
4
G
1
Posts: 42
Reputation: 1,775

Post » Tue May 21, 2013 11:12 am

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
*/Peret2013-05-21 11:12:44
B
14
S
4
G
1
Posts: 42
Reputation: 1,775

Post » Wed May 22, 2013 10:23 am

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
Peret2013-05-22 13:10:25
B
14
S
4
G
1
Posts: 42
Reputation: 1,775

Post » Wed May 22, 2013 4:04 pm

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

What browser are you using? If Chrome, try running in Icognito mode.
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Thu May 23, 2013 9:35 am

@AracadEd
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 http://www.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 http://www.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.

B
14
S
4
G
1
Posts: 42
Reputation: 1,775

Post » Thu May 23, 2013 6:50 pm

Works for me Peret. Maybe you've fixed it already but I died, entered the name "test" and it showed up right away.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri May 24, 2013 12:03 pm

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 @AracadEd

Peret2013-05-24 12:10:23
B
14
S
4
G
1
Posts: 42
Reputation: 1,775

Post » Mon May 27, 2013 10:17 am

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.



B
14
S
4
G
1
Posts: 42
Reputation: 1,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests