- Home /
Php not downloading data for game on web player
I have built a game that includes some php calls to retrieve leader boards scores etc. This works fine online when on my localhost...I then duplicated the site and game and published on the web.
I then published this game on the real site yet the php fails to work under the error found in the console --
Failed downloading http://localhost:8888/resources/check_scores.php
I have changed the ProjectSettings/editor, WWW security emulation settings to the current website example www.example.co.uk/project, crossdomain.xml is also uploaded. I have also changed the javascript for example -
Original:
$url = "http://http://localhost:8888/GravBallWebsite/update_level_score.php"
New:
$url = "http://www.gravball.co.uk/update_level_score.php"
Yet the game somehow still calls the original URL localhost!
Is there something i'm missing or something I need to change on the website security settings/code for the game to download from the new website and not the original host.
I'm guessing it's something really simple as I know what the error is.
The game works fine online when I turn on my localhost and when local host is turned off it doesn't work so the game is somehow still relying on local host??? Even though I have changed the javascript/php to the new website's url. Any help would be very much appreciated!
You've presumably got some game script code that called into the WWW class. In your post you have $url shown, which I assume is a PHP variable. That tells me that you game code must ask some PHP code what the URL is for the update_level_score script. You'll probably want to debug the code that gets this URL. The only thing I can think of at the moment is that the web player uses the web browser when you call WWW, so the browser might be getting a cached version. Try blowing away your browser cache and try again.
Graham what I did was set the new variable to URL2 and it now works online!! Thanks for your help.
Answer by tw1st3d · May 11, 2012 at 01:07 AM
What you can also do is this.
$url = "http://http://localhost:8888/GravBallWebsite/update_level_score.php";
$url .= "http://www.gravball.co.uk/update_level_score.php";
Your answer
![](https://koobas.hobune.stream/wayback/20220613071301im_/https://answers.unity.com/themes/thub/images/avi.jpg)