WWW form - couldn't connect to host

Hi, i have a problem with WWW form, when i’m in localhost, the www form work great and connect to my localhost php server, but when i put the php pages in an online php host service (www.altervista.org) an error appers and says: couldn’t connect to host.

Where is the problem?

Without any code it would be hard for us to know but my first guess would be that the WWW commands are not edited to reflect the new location of the PHP files.

This is the www form code:

var form = new WWWForm();
form.AddField( “hash”, hash );
form.AddField( “username”, playerNameInput );
form.AddField( “password”, playerPasswordInput );
var w = WWW(URL, form);
yield w;

And this is the URL var:

var URL = “http://wararm.altervista.org/gioco/login.php”;

Try this and look at what error your getting:

var URL = "http://wararm.altervista.org/gioco/login.php";

function OnGUI () {
	if (GUILayout.Button ("test")) {
		ExecWWW ();
	}
}

function ExecWWW () {
	var form = new WWWForm();
	form.AddField("hash", "a");
	form.AddField("username", "a");
	form.AddField("password", "a");
	var w = WWW(URL, form);
	yield w;
	Debug.Log (w.text);
}

Maybe this?

Note: 
The security sandbox present in web-player builds, 
prevents you from accessing content not hosted on the server where the webplayer is hosted.

most probably, just hard to know without any decent error message.

No, i print the w.error couldn’t connect to host. I use a standlone version of the game, not a web player version!

maybe you could show us your php code? of course with the database connection information edited out, but maybe there’s a problem with the way the php code is set up? (I’m not sure if that’s the case with the error you’re getting tho)

Yes, the php code is working on localhost so i think that it’s working to in remote hosts.

Try simply to read the page as a test :

var URL = "http://wararm.altervista.org/gioco/login.php";

function Start () {
    var w:WWW = new WWW (URL);
    yield w;
    Debug.Log (w.text);
}

that should give you html output