I need some advise on PHP and web app, and I want to create a system that allows user to login and write/read their text. Imagine a simple website that each user can write or read only one simple text file.
Suppose the user successfully logins to the website, the PHP will check whether the user's name is in the database. If there is a matched user/password, the PHP show a huge text area, a "write" button and a "read" button on to the site. (perhaps actually another page or have Javascript modify the site on the fly)
Now, if the "write" button is pressed, all the text from the huge text area will be written into "[username].txt" on the server and "read" button will read "[username].txt" and paste it into the text area.
Now, the technical details: suppose we saved the user/pass (perhaps in a cookie), when we hit the "write" button, I can see that I can just send the saved user/pass along with all the text in the text area as well as having a read/write variable specifying "write" into POST method and then have PHP write all the text into "[username].txt".
For "read" button, we specify user/pass and read/write variable specifying "read", and the server will read "[username].txt" and put it into the text area.
Questions:
Do real websites actually do something along the line like above? How do real websites actually do this?
Is it possible to send the text in the text area to the server without specifying user/pass into POST the second time?
If there is anything incorrect from what I've mentioned above, please feel free to correct. Any advise is appreciated.