HTML is a mark-up language that is interpreted in your browser to define how a web page should be structured and in some cases how it is styled (colors, etc). CSS is a better method to style web sites, as it provides a central document that can control the colors, layout, font sizes and type, borders, etc that will update every page that links to that CSS document. It also reduces redundancy by letting you create style rules in one document rather than having to update every page on your site to change a font size.
Javascript is a scripting language that runs in your web browser to do dynamic events. When you are typing a reply on Fluther and you see the Live Preview down below, that is done with Javascript. Javascript is also frequently used in image galleries to make images appear over the regular web page, to validate the data submitted in forms, resize elements, etc. There are thousands of scripts available online that will do almost anything you want, so I would not spend a huge amount of time learning Javascript. It’s rare that you won’t be able to find a script to do what you want without having to duplicate the effort of creating it from scratch.
PHP is a server-side language that allows the web server to follow programming logic to make decisions and change the HTML file that is sent to the browser.
MySQL is a database system that runs on the server to hold information, which is accessed by the PHP script.
So, to use Fluther as an example, say you want to post a new question.
You push an “ask question” button. The browser sends a request to the server after some initial handshaking that it would like a file on the server called ask_question.php. The server sends that file to the browser (which contains only HTML, for simplicity’s sake). The browser looks at the HTML and notices that a CSS file and a Javascript file and some images are linked inside. It sends more requests to the server asking for the CSS, image and Javascript files so that it can finish interpreting the HTML and displaying it on the screen.
Now you see the web page on your screen and start typing a question. While you are typing, there is a Javascript script running that automatically takes what you are typing and displays it in a designated area of the page as HTML so that you can see a preview of what you are typing.
When you have finished the question you press the Submit button, which runs a Javascript script that checks the data you entered to make sure it was filled out correctly. It might make sure that there are no empty fields, make sure that an email address is formatted correctly, make sure two passwords match, etc. If there is an error then the Javascript pops up an error message to let you know without submitting the data.
If the data is ok, then the browser connects to the server and says it needs thanks.php, and it also has some information attached that was entered on the form. The PHP script looks at the data that was submitted by the form, sees that it has instructions to save this data, so it connects to the MySQL database and sends it the information along with commands on how and where to store the information. Then the rest of the script may say to send HTML back to the browser that says thank you for submitting a question, etc. The CSS and Javascript file do not need to be downloaded again unless they have changed, because they are cached on the local computer running the web browser and are the same for the whole site.
Next another person comes along and wants to look at questions, so their browser asks the server to send it display_questions.php with a list of the questions on the site. So the server opens the PHP document and sees that there are parts of the page that say to load information from the database. So it connects to the MySQL database, issues a couple commands to tell it what information it needs, plugs that information into the specified area of the HTML document, and sends the HTML document to the person’s browser with the question information inserted from the database.
That is a simplified explanation and of course doesn’t exactly match Fluther, but I think you’ll get the idea. :)