Hy I have been trying to get a unity ↔ php ↔ mysql connection but The damn "cross domain policy " error keeps poping up…I have read other forums and I trying prety much evreything
I have went under Project Settings->Editor and wrote my domain in there
and then I even put a crossdomain.xml at the root of the webserver even though conform to the docs that was not necessarily because the php files and the webplayer are hosted in same place…
Without any code we can’t do much else then send you to the docs.
Usualy what i do to make sure my connection PHP works is use a test page that returns a message to a query.
Then debug any errors in Unity.
Evreything works great in Standalone mode but if I switch to it Webplayer doesen’t work
this is the initial function that gets called and prodces the error
function getStats()
{
var www:WWW=new WWW(linkMain);
yield www;
//Debug.Log(""+www.text);
curState=int.Parse(www.text);
conected=true;
}
And this is the php code that gets called by the code above
<?php
include "includes/credentials.php";
include "includes/connectDB.php";
connectDB($host,$user,$password,$database);
$queryOUT=mysql_query("SELECT state FROM setup" ) or die ("Query Error");
$stateX = mysql_fetch_array($queryOUT,MYSQL_BOTH);
echo $stateX["state"];
?>
This is the most simple block of code that I put to the test.