@ Leah
You need to make sure that the code is between opening/closing PHP tags otherwise it is just text. The tags are <?php and ?>.
<?php
?>
Hope that helps!