php isnt sent to the browser, it all happens at the server - so any code that goes between the <?php and ?> tags is executed on the server. Hence, it can go everywhere and anywhere - some people use it to generate their entire pages, some people use it just to do bits.
It does sound like you're quite a noob (no offence, we were all there once), so i'd suggest first off buying a book (I use PHP and MySQL Web Development by Luke Welling, Laura Thompson and it's fab), because otherwise you'll be back here every 5 mins asking another question which will take a few hours to get a response to, and in the mean time you could have very quickly looked it up.
Such a book will also tell you that doing php isnt just like writing html - you need other software. Specifically you will need a hoster who supports PHP - not all do, and usually the free ones dont. If you have that, then you'll probably need your own server since it's much easier to test files locally before uploading them, so then you'll need the Apache server (which is free from www.apache.net ) and for later on you'll need MySQL server (which is also free from www.mysql.com ). oh you'll also need the PHP engine, which you can get from www.php.net . Note also that the PHP site is a fab resource for info and should be your first port of call if you're stuck - have a look in their manual for anything you need clarification on before posting here, since peoiple will get pretty tired of your questions if the answers arent that difficult to find elsewhere.
As a final note though, you dont need php to do what you want. A lot of people will use a CGI script which many many hosters will provide for you if you just ask them (or read their documentation) - it's usually called a form to mail script or something, so have a look around in your documentation. And with that said, php is really good fun to learn to use, and it's a pretty useful skill once you've got a bit of practice, so even if you dont need it in this case, you should start learning it anyway since you'll wonder how you ever did websites without it.