Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Server.HTMLEncode equivalent for VFP?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00456699
Message ID:
00456887
Vues:
35
Rick, I think your code example got garbeled because of UT's own HTML stripping.

>>
>>Can anbody recommend how to use Server.HTMLEncode for IIS (assuming either IIS or PWS is installed on the same PC) from within VFP, or otherwise get the equivalent functionality of Server.HTMLEncode from within VFP? In other words, I need a text-to-HTML encoding function that translates ">" and "<" and other special characters to the appropriate > and < syntax. Thanks.
>>

>
>I usually use two functions for this (mainly for displaying HTML and code
>in an HTML document):
>
>
>************************************************************************
>Function FixHTMLForDisplay
>************************************************************************
>#IF .F.
>*:Help Documentation
>*:Topic:
>wwUtils::FixHTMLForDisplay
>
>*:Description:
>This method fixes up HTML for display. Takes HTML and XML tags and converts
>them to HTML displayable characters (< for < for example).
>
>*:Parameters:
><>lcHTML<>
>HTML to fix up.
>
>*:Returns:
>Fixed up HTML
>*:ENDHELP
>#ENDIF
>************************************************************************
>LPARAMETER lcHTML
>
>lcHTML = STRTRAN(lcHTML,"<","<")
>lcHTML = STRTRAN(lcHTML,">",">")
>lcHTML = STRTRAN(lcHTML,["],""")
>
>RETURN lcHTML
>
>
>************************************************************************
>FUNCTION DisplayMemo
>**************************
>*** Function: Fixes linebreaks into HTML breaks
and


>*** Pass: lcHTML - HTML to fix
>*** Return: Fixed HTML
>*************************************************************************
>LPARAMETER lcHTML
>
>lcHTML = STRTRAN(lcHTML,CHR(13)+CHR(10),CHR(13))
>lcHTML = STRTRAN(lcHTML,CHR(10),CHR(13))
>lcHTML = STRTRAN(lcHTML,CHR(13)+CHR(13),"

")
>
>RETURN STRTRAN(lcHTML,CHR(13),"
")
>* FixHTMLLineBreaks
>

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform