I've created a contact form but all I get is code when I publish the page!
Contact forms require that your server support PHP. Without PHP a form will not work, at all. When loaded on a server that does not support PHP you will end up with a page full of text. Some browsers will not display the code at all, but instead download the PHP as a file, leaving your browser window blank.
You’ll want to check with your host to ensure that they have PHP installed on your server. Most hosts nowadays give you PHP access at no charge. If you don’t have it, be sure to ask them to give you access to PHP for your server.