- Home /
WWW does not work on localhost
I want to access the data from my WAMP based database on localhost using the below script.I have placed my php code inside wamp by creating a folder called unity_db.I have taken the build of the project,the build project is not connecting to the database.Can anybody plz help me
IEnumerator handleLogin(string user,string pass)
{
string login_url = loginCode + "?username=" + user + "&password=" + pass;
WWW logindata = new WWW (login_url);
yield return logindata;
if (logindata.text == "right")
{
output = "login successful";
}
else {
output="invalid user pass";
}
}
string loginCode="http://localhost/unity_db/login.php"; this is the value of login code
Were all wamp services started? Could you reach that link you gave from a browser? What's the error?
ys wamp service is started.
http://localhost/Database demo/Database demo.html
Even I have changed the WWW Security Emulation host url to http://localhost/unity_db where my php code is placed inside the unity_db folder.I have place the crossdomain.xml file inside my project Asset folder.
Did you check if that url is accessible from browser?
Also post the version of wamp server and OS you are using. (For check against compatibility issues)
ys from browser the url is accessible.When I take the build of the project then work it its not working. WampServer 2.0 Windows & 64-bit OS