réponse www.text non comprise par mon script

hello, I have an incomprehensible concern.
I send a request to my server (localhost).
2 it does not send me error code but, in my PHP script a confirmation by (echo = “1”) if my datas are correct (login, pass).
3 in my C # script my debug.log line responds well “* 1 *” but my if (www.text == “1”) does not detect it
there I am dropped I do not understand why the www.text is not recognized as “1”

I thank you in advance for your answers.

bonjours, j’ai un souci incompréhensible.
1 j’envois une requête à mon serveur (localhost).
2 il ne me renvoie pas de code erreur mais, dans mon script PHP une confirmation par (echo = “1”) si mes datas sont corrects (login,pass).
3 dans mon script C# ma ligne debug.log répond bien “1” mais mon if (www.text == “1”) ne le détecte pas
là je suis largué je ne comprends pas pourquoi le www.text n’est pas reconnu comme “1”

je vous remercie par avance pour vos réponses.

yield return www;
if (www.error == null)
{
Debug.Log (“" + www.text + "”); = 1
if (www.text == “1”)
{
Debug.Log (“passer 3er etape”);
Logmsg.color = Color.green;
Logmsg.text = “Login in the courtyard please wait”;
StartCoroutine (Menu ());
}
else
{
Logmsg.color = Color.red;
Logmsg.text = “Invalid login or password”;
}
}
else
{
Debug.Log (www.error);:wink:
if (www.error == “Could not resolve host”)
{
Logmsg.color = Color.red;
Logmsg.text = “Unavailable server”;
}

Try checking www.text.Length or printing the codes for individual characters.

print(www.text.Length ); // = 2 ^^
mais je n’arrive pas a convertir (www.text [1]) en string

It sounds like it’s your php output that’s incorrect - it’s most likely outputting some UTF-8 BOM header or Unicode characters that Unity doesn’t like.

Make sure your php file is encoded as UTF-8 (e.g. open in notepad2, go to file->encoding->utf-8). This is important as the PHP file type determines how the server outputs any text from it. (unless you’ve specifically set the output as part of the HTTP header)

thank you, I will control but for the moment I have avoided the problem with this line

string re = (www.text [1]).ToString ();