When you send a link (either directly in an email, or through a small HTML page) and the other person clicks it, the browser will determine what to do with it, with some server-side input.

When, for example, you link to a JPG file, the browser will display it instead of asking whether the user wants to download the file. When you have a PHP file, the server must be configured correctly to handle such files. If the server does not know what to do with it, nor does your browser, your browser will ask what to do with it, view or download....you can then select the download option...