Output (ie print and echo statements, and anything outside the <? ?> tags) is given directly the the web server.
Input is handled via a set of global array variables. The main ones you'll see are called $_POST, $_GET and $_REQUEST. These are initialised when the script starts, and contain the data that was sent by the web user via the web form or the get request variables in the URL, etc. You may also come across $_FILES, $_SERVER, $_SESSION and $_COOKIES; the names are fairly self explanatory.
Hope that helps