To elaborate on dimkir's answer: It depends much on what you have configured on the Web server side.
E.g., I use a database (in my case FileMaker, but it could be also MySQL) and a PHP script (or a script in another script language) that accepts an AJAX-type query and writes the parameters to the database.
AJAX calls usually expect a response (XML or JSON) that is sent back from the server and which signifies if the call was successful or not; the response is handled by a JavaScript callback function.
I don't have a short example at hand (and also no time to write one).
If you are interested to look at a lengthy example, you can look at the library navigator (a general map system for buildings and their interiors) I have written: http://www.clicaps.ethz.ch/librarynavigator/index.php?lang=en
The left navigation bar (JS , js/library_navigator_en.js) and canvas (PJS, library_space.pde) act independently, but communicate with each other.
If the user switches the floor in the PJS canvas (by clicking G, H, J, or J-GR), this action will be stored in a database.
The PDE code calls a JS function floor_switch_applet (passing the view index of the map).
floor_switch_applet calls function storeAction in the JS code and passes an action query containing the action type ("store a floor switch") and the action values (view index and floor index).
storeAction uses the YUI library datasource module (which provides AJAX) to define a datasource and then send a request using the action query to it.
the callback function defined in actionDataSource.sendRequest handles the response (either doing nothing or passing parameters back to PDE).
This is one way. As dimkir pointed out, there are millions of different ways.