I am currently studying in software engineering. We learned how to do programs offline. However,
now I'd like to do a document formatting. In other words, the user puts content in a form, clicks "submits" then it will output
all the content that the user has input, in a formatted way. Here are the steps that I thought of :

1 - create a simple HTML form
2 - event -> send the information into a MySQL database
3 - the java program will extract information from the database
4 - it will print in a .Tex document (using LaTeX to format the document)
5 - the .tex document will then compile and output a formatted document.

I would want this to run on a server, but I have no idea how...

Could someone enlightened me in this subject?