I work in PHP, and my recent work involves interacting with ios and Android, so I have a few questions.
1: After logging in on the mobile terminal, how to record the currently logged in user information? The web terminal uses session, but what is used on the mobile terminal?
2: The mobile terminal still uses get and post to upload data, but when saving files, it is said online that the $_FILE array cannot be used. It can only convert the POST information into binary and save it into a file. Is there any ready-made code that I can refer to? Down?
I have only written json interfaces before. I hope someone with back-end experience in mobile terminal development can give me some advice. Thank you!
I work in PHP, and my recent work involves interacting with ios and Android, so I have a few questions.
1: After logging in on the mobile terminal, how to record the currently logged in user information? The web terminal uses session, but what is used on the mobile terminal?
2: The mobile terminal still uses get and post to upload data, but when saving files, it is said online that the $_FILE array cannot be used. It can only convert the POST information into binary and save it into a file. Is there any ready-made code that I can refer to? Down?
I have only written json interfaces before. I hope someone with back-end experience in mobile terminal development will give me some advice. Thank you!
You can maintain a token on the web side. When the client logs in, the token returned by the server is saved, and all subsequent requests will bring the token; until there is a token and the server does not return expiration information, it is assumed that the client has logged in.
If you use some network connection framework, you don’t need to convert it into a byte stream yourself. You only need to pass in the file name and path.
The mobile interface is the same as the web. Session is also used to record login status. To save a file, use $file=$_FILES['upfile'];, I remember there is no need to convert it