Where to insert code in a php page?

Hi,
I get an error when I insert the code befor the ?of the end , or after.
Where to insert it?
Thank you.