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

How to define a cfinclude page as a variable? 1

Status
Not open for further replies.

jeff1

IS-IT--Management
Nov 8, 2000
49
US
I would like to loop through a cfincluded page and use a RemoveChars function, or other function, to remove all references to "font size" before a page is displayed to the user, the included page is a .htm page uploaded by a user.
Is this possible ?

Thank you for your help.
 
yes, let the name of the cfincluded page be a variable and eval it - then act with it just like it a "normal" cfinclude
good luck :)
 
I do not know the proper syntax for setting a include page as a variable, <cfset myvariablename= ?>
 
Hey Jeff,

You could also try reading the file in with CFFile into a variable called &quot;var1&quot;. You could then display it like this.

<cffile action=&quot;read&quot; file=&quot;c:\file1.htm&quot; variable=&quot;var1&quot;>

<cfoutput>#replace(var1,&quot;font size=&quot;,&quot;&quot;,&quot;all&quot;)#</cfcoutput>

Hope this helps,
GJ
 
Thanks GunJack it works great. Is there anyway to use &quot;wildcard&quot; attributes to catch all the references like font size=&quot;*&quot; all my attemps have failed.
 
You could use ReReplace which uses a &quot;regular expression&quot; for matching strings to replace. Regular expressions are created with a special syntax which allows for advanced pattern matching much more sophisticated than dos &quot;*&quot; or &quot;?&quot; matches. Entire books have been written about regular expressions so they aren't trivial to master. I've never done anything with them so I can't tell you the syntax for what you would need. If you do a search on regular expressions, you should find some tutorials or info that will help you find the syntax you need.

Good luck,
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top