Hello,

I have just a regular .html page. I want to take my PHP source code from one of my PHP scripts and display that to the viewer so they can see my code on the HTML page, as if it was just regular content on a page.

When I copy/paste the PHP code into a <p></p> it doesn't display it properly. Does anyone know how I could do this? Thank you.

Andrew

Recommended Answers

All 2 Replies

You have to encode the brackets < >, otherwise they're interpreted as HTML tags and wont display to the browser.

you need to use php tag (<?php ......?>) in between these you can write your php code...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.