I have this code on my website:
<textarea name="code" cols="20" rows="5">
<?php
echo "Your IP is: ". $_SERVER["REMOTE_ADDR"];
?>
</textarea>
I want it so that it shows the code as text, not run it.
Can this be done?
I have this code on my website:
<textarea name="code" cols="20" rows="5">
<?php
echo "Your IP is: ". $_SERVER["REMOTE_ADDR"];
?>
</textarea>
I want it so that it shows the code as text, not run it.
Can this be done?
You can either wrap your code in <xmp>
tags:
<xmp>html code</xmp>
Or use PHP's built in htmlentities function:
$hmtlcode='stuff';
echo htmlentities($htmlcode);