php WWW not working in unity web player

Hi guys,

Got a problem with php in my game, it works in standalone player and mac osX version etc but does not work in the web player when built.

The game was built in to the same file as the crossdomain.xml and web server so I don’t think that’s the problem. And I am not using loops, I think I am using yield correctly.
Any help would be much appreciated!

 var highscoreUrl="http://localhost:8888/********/resources/get_score.php?";
 public var stylish = new GUIStyle();
 public var stylish2 = new GUIStyle();
 public var stylish3 = new GUIStyle();
 public var stylish4 = new GUIStyle();

function Start(){
  var hs_get = new WWW(highscoreUrl);
yield hs_get;
if(hs_get.error) {
    print("There was an error getting the high score: " + hs_get.error);
} else {
   gameObject.guiText.text = hs_get.text;  //this is a GUIText that will display the scores in game.
   //formText = hs_get.text;

function OnGUI(){
if (GUI.Button(Rect(-70,0,250,40), "Main Menu" ,stylish2)){

GUILayout.BeginArea (Rect(100, 70 ,Screen.width -200,80));
		if (GUI.Button(Rect(0,0,200,40), "" ,stylish3)){	
		if (GUI.Button(Rect(210,0,200,40), "" ,stylish4)){
		if (GUI.Button(Rect(420,0,200,40), "" ,stylish)){	


The cross domain policy needs to be utf encoded
<?xml version="1.0" encoding="UTF-8"?>
also the file should be in the root or index of the web folder! Pretty basic mistake…thanks to Paulius Liekis and rutter for your input. :slight_smile: