PHP code is not working on my website; displays the code

By default (and on all of our shared servers), it is important to have your PHP code in .php files, because .php files are set up on most servers to be dealt with by the PHP interpreter (the software on every server to be able to use the PHP programming language). If you add such code to .html files, it will not actually do anything, because those files are not set to be parsed (rendered / executed) by the PHP interpreter.

This is quite basic for many people, but beginners to PHP or web development may not realise this.

Powered by BetterDocs