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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to display snippets 1

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
Im am developing a ASP help site, and I want to display snippets.

I could do them database driven, but I was hoping to display the output of the code. What do you all think about this matter?
 
sounds ok - just encode the snippets so they look ok coming back out:

going into the database I would use:
Code:
Function encodeSnippet(sSnippet)
  sSnippet = Server.HTMLEncode(sSnippet)
  sSnippet = Replace(sSnippet,VbCrLf,&quot;<br />&quot;)
  sSnippet = Replace(sSnippet,&quot;'&quot;,&quot;''&quot;)
  encodeSnippet = sSnippet
End Function

and coming from the DB to HTML I would use:
Code:
Function decodeSnippet(sSnippet)
  sSnippet = Replace(sSnippet,&quot;''&quot;,&quot;'&quot;)
  decodeSnippet = sSnippet
End Function

======================================

if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top