Issue with Extra Spaces in Communication Between App Inventor and PHP Server

I am developing an E-commerce project using MIT App Inventor for the mobile app and a MySQL server to store the data. However, I am experiencing an issue with the communication between the app and the PHP server.
Issue Description:

I am sending data from App Inventor to a PHP script that connects to a MySQL database.
However, when receiving the data on the PHP server, there seem to be invisible spaces or unexpected characters in the variable values.
This is affecting login validation when displaying return messages in the app, as they appear with a extra space.



php codes.txt (559 Bytes)

Encode your data with this?
image

Besides the URIEncode, you might need to pay attention to

https://dev.mysql.com/doc/refman/8.4/en/charset.html

in case of misconfiguration.

AI2 uses UTF8.

1 Like

It worked, the code removed the extra space and replaced it with these characters: %0D%0A. From what I saw, they correspond to the /r and /n codes in PHP, but there are none of them in the logar.php code.

then mark it's as solution.

sure, thanks!

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