Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display html code

Status
Not open for further replies.

acidbrain

Technical User
Sep 2, 2002
67
RO
Hi there,
I'm kinda new to this so laugh at will :))

I'm trying to display a html code ( a banners code) on a page but no matter what i do, where i put that code,it's being read and displed, so i have 2 banners . My Q is ( dunno if it can be done in html): how do i display a html code on a web page so that others can copy it and put it on their sites? I used every tool i have but the banners code is displayed twice. At a certain time i took a script called "scrollable content", adapted it to my needs but when i put in the content i want it still displays my banner. I also know that this can be done in php but, can it be done in html too?
Suggestions?

Thanks in advance.
 
try using a textarea and make the sample html - code it's default-value.

how's that doing?

__________________________________________
a programmer is a tool that converts coffee into code...
aschi666, sthcomputing.de
 
Using <pre></pre> tags and textarea/sample html doesn't work. My banner is still diaplayed :/
I'll try further on, if not i guess i'm gonna make a txt file and let people download it :))
Thanks :D
 
I see your problem

try replacing the < with &gt; like so

Code:
&lt;p>Hello&lt;/p>
&lt;p>World&lt;/p>

The pre tags are actually unncessary I guess, but they will cause your code to be displayed with line breaks etc as formatted.



Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
have you even tried it? but here's the example:
Code:
<html>
<body>
<textarea name="msg" cols="55" rows="8" tabindex="2" id="textfelder">
<img src=""></img>
</textarea> 
</body>
</html>

make a file from it, load it and tell me if THAT is working, please!
how's that banner-code looking anyways?

__________________________________________
a programmer is a tool that converts coffee into code...
aschi666, sthcomputing.de
 
SO, if i make an image it works but i would like to make people possible to copy that code and insert it into their pages. If i put this code using an image you'd have to write the whole code. That' why i want to make it possible to copy.
Here's the code:
<table width="138" border="0" cellspacing="0" cellpadding="0" align="center" height="40">
<tr>
<td bgcolor="#FFFF99" height="11">&nbsp;</td>
</tr>
<tr>
<td height="40" bgcolor="#FFCC00">
<div align="center"><b><font color="#0000FF" size="4"><a href=" </a></font></b></div>
</td>
</tr>
<tr>
<td bgcolor="#FFFF99" height="12">&nbsp;</td>
</tr>
</table>
 
Code:
<html>
<body>
<textarea name="msg" cols="55" rows="8" tabindex="2" id="textfelder">
<!--YOUR TABLE:-->
<table width="138" border="0" cellspacing="0" cellpadding="0" align="center" height="40">
  <tr>
    <td bgcolor="#FFFF99" height="11">&nbsp;</td>
  </tr>
  <tr>
    <td height="40" bgcolor="#FFCC00">
      <div align="center"><b><font color="#0000FF" size="4"><a href="[URL unfurl="true"]http://domain.com">domain[/URL]
        </a></font></b></div>
    </td>
  </tr>
  <tr>
    <td bgcolor="#FFFF99" height="12">&nbsp;</td>
  </tr>
</table>
<!--IN THE TEXTAREA-->
</textarea> 
</body>
</html>

just do it that way!

__________________________________________
a programmer is a tool that converts coffee into code...
aschi666, sthcomputing.de
 
You're the man! :)
Thanks alot. It finally works.
 
you're welcome,
glad i could help...

__________________________________________
a programmer is a tool that converts coffee into code...
aschi666, sthcomputing.de
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top