Go Back   CodingForums.com > :: Client side development > General web building

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-17-2002, 06:39 AM   PM User | #1
McP
New to the CF scene

 
Join Date: Jun 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
McP is an unknown quantity at this point
html in text boxes

i want to have text boxes with code in them for viewers to copy... i have the text box code but any html i put into them wont show on page or is altered (so the browser dosent read them i guess??)...i tried some different things but still no luck...any help is welcomed....... THANKS
McP is offline   Reply With Quote
Old 06-17-2002, 07:54 AM   PM User | #2
boxer_1
Regular Coder

 
Join Date: May 2002
Location: Maine, USA
Posts: 574
Thanks: 0
Thanked 0 Times in 0 Posts
boxer_1 is an unknown quantity at this point
Use special characters

You'll need to use special characters (ISO Entities) for your angle brackets (<...>).

Let's say your offering code inside of a textarea for your visitors to copy. As opposed to inserting your code like:

<html>
<head>
Etc.....

You need to use &lt; and &gt; to make your brackets. Here's an example:

<html>
<head>
<title>Example</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" alink="ff0000" vlink="#800080">
<form>
<textarea rows="7" name="displayHTML" cols="45" wrap="virtual" style="width:50%">
&lt;html&gt;
</textarea>
</form>
</body>
</html>

Copy/paste/preview the above to see what I mean.

See http://hotwired.lycos.com/webmonkey/...al_characters/ for more special characters.

Sorry for such a brief explaination, reply back here if you need further assistance .
__________________
boxer_1
CodingForums Moderator
"How did a fool and his money get together in the first place?"
boxer_1 is offline   Reply With Quote
Old 06-17-2002, 02:21 PM   PM User | #3
Jeewhizz
Regular Coder


 
Join Date: May 2002
Location: London, England
Posts: 369
Thanks: 0
Thanked 0 Times in 0 Posts
Jeewhizz is an unknown quantity at this point
You can do this if you have PHP on your server. Just create a string with the html in it and use the following code

PHP Code:
<?
$string 
"<html><head>....</html>";
echo 
htmlspecialchars($string);
?>
__________________
Jeewhizz - MySQL Moderator
http://www.sitehq.co.uk
PHP and MySQL Hosting
Jeewhizz is offline   Reply With Quote
Old 06-17-2002, 08:30 PM   PM User | #4
McP
New to the CF scene

 
Join Date: Jun 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
McP is an unknown quantity at this point
&lt; &gt; is just what i needed.........Thank You both for responding
McP is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:16 AM.


Advertisement
Log in to turn off these ads.