Jump to content

Having trouble displaying html code as code


n8frog

Recommended Posts

Hello again everyone. I have nearly completed my first php web site YAY! Unfortunately however I have run into a problem that I have no idea how to fix. I have created a simple click tracker to count the number of clicks on a certain link. This is working as intended but the problem is that I need to display the html code for the link so it can be copied and pasted into a web page. I have tried using

< and >

to display the tags however it does not seem to work.

 

example

[code=php:0]echo "<a href="http://www.mywebsite.com">Anchor Text</a>";

[/code]

 

When I try to set the value of a text box with an echo similar to the one above, nothing is displayed in the text box at all.

Also when I tried to use these escapes in regular html on my page, it displayed everything except the escaped characters.

 

Am I missing something? My page has

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

in the head. Should my page be encoded in a different char set to make this work correctly?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.