Problema procedura IF...ELSE

Screenshot 2023-11-17 180120

Non riesco a capire se metto diverso da "Login" funziona, come è possibile il ResponseContent è "Login"!!!!!!! non capisco la logica. Mi puoi aiutare a capire?

it might be, that your server does not send only Login, but additionally some invisible characters? For example a carriage return? Therefore my suggestion was

if resposne content contains "Login"
then...

Taifun

1 Like

contains
Ciao @Domenico_Armenante
prova questo se funziona vuol dire che nel responseContent ci sono dei caratteri non visibili
Ciao
Marco

1 Like

sono sicuro che il text di risposta contiene solo "Login", non potrebbe essere un problema d'interfaccia grafica dell'app?

come faccio ad utilizzare il blocco testo al posto del blocco if then?

Non capisco cosa vuoi dire, non riesci a replicare quello che ho scritto sopra?

Non riesco a capire se metto diverso da "Login" funziona, come è possibile il ResponseContent è "Login"!!!!!!! non capisco la logica. Mi puoi aiutare a capire?
Screenshot 2023-11-17 180120

potrebbe esserci un bug nell'interfaccia grafica?

If you want to continue if both values are the same, you have to choose the = sign in the logic block.

Show your response content, put it in a label

Procediamo per gradi.
1 non c'entra nulla l'interfaccia grafica
2 il fatto che se tu metti "diverso" da Login e funziona, nel tuo blocco qui sopra conferma che responseContent contiene dei caratteri non visibili
3 prova il blocco che ho scritto sopra, esegue un check se nella stringa responseContent è presente la stringa "Login" esegue le istruzioni seguenti, anche questo conferma che ci sono dei caratteri non visibili

yes... and btw these invisible characters are provided by your server ...
therefore

Unbenannt

or fix your server script

Taifun

come?

ok... it looks like there is an invisible character before the text, most probably a cariage return... \n......
Unbenannt

when do you start following one of the already given advices?

Taifun

Screenshot 2023-11-17 223908
ho provato ma non cambia nulla

Unfortunately we do not know, what you are testing now... show us another screenshot so we can see the response content

Also as test you could display the response content in a label to do some tests using Do it...
For example let's assume, you are testing admin..
After executing Web.Get then check, if Label1 Text contains the text piece admin

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.


questo è il codice php.

ho provato i vostri suggerimenti ma non riesco ha togliere a capo prima della stringa.....

Screenshot 2023-11-17 223908

ho provato anche questo senza successo........

what about following the debug recommendations?

the part of the php script looks ok... you could try this method: App Inventor Tutorials and Examples: MySQL | Pura Vida Apps and then after you got this running successfully adjust it to your needs

also I hope very much, that you do not store passwords as plain text in your database... I hope, you store hash values instead to compare with the user input...

What is password hashing? - Stytch.

Taifun

ringrazio tutti per l'aiuto ho risolto aggiungendo un blocco trim, infatti il vuoto erano una serie di spazi non un a capo.
grazie ancora a tutti

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.