I am trying to create a webpage that will show the end user a HTML script, however, when I show it on the page, it simply gets parsed by the browser. What I want, is to show the raw HTML code to the user, not the output.
You can use the tag <pre></pre> & <code></code> : <pre> <code><html></code> <code><head></code> <code></head></code> <code><body></code> <code>Some text here</code> <code></body></code> <code></html> </code> </pre> Code (markup):
If you have access to php... Maybe you can store the source you want to display in a file and using both get_file_contents() and htmlspecialchars() display the source. The second function will replace the < with < and the others aswell.
If you're building a teaching website or trying to teach something I recommend putting it inside a textbox - that will make it easier for the user to copy & paste the code in order to try it out.