You need to do this:
To start PHP script/code:
<?php
put_your_code_here
when done with the PHP, use
?>
<?php tells the server/php engine to interpert that part of the code, while ?> exits. You can start/stop as many times as you want...just make sure to leave the HTML code outside of the PHP start/stop codes!
Is that what you meant?