On 3/12/08, Bruce Sorge <[EMAIL PROTECTED]> wrote:
>
> I have a client who wants me to make a change to a form he has.
> Currently he has a page that creates a new project that uses a WYSIWYG
> editor and put everything into a database table. What he wants instead
> is for the user to add a page name field in addition to the fields he
> already has, and when the user submits the form, he wants a .cfm page
> created with the value from the page name field being the file name. Of
> course I need to put the site's header and footer on there as well. So
> is there a way that I can create a template, and then when the form is
> submitted, using CFFILE or something like that to take that template and
> make a new page with it? Does this even make sense?
>
> Thanks,
>
> Bruce



Yeah, I do something like this, you may know some regex that could eliminate
half of this junk at the beginning.

<cfset FixedPageName =replace(FORM.PageName," ","-","all")>
<cfset FixedPageName =replace(FixedPageName,":","","all")>
<cfset FixedPageName =replace(FixedPageName,"?","","all")>
<cfset FixedPageName =replace(FixedPageName,"$","S","all")>
<cfset FixedPageName =replace(FixedPageName,"&","-and-","all")>
<cfset FixedPageName =replace(FixedPageName,"'","","all")>
<cfset FixedPageName =replace(FixedPageName,".","","all")>
<cfset FixedPageName = LCase(FixedPageName)>
<cfset 
FORM.FixedPageName=replace(FixedPageName,"#FixedPageName#","#FixedPageName#.cfm","all")>

<CFPARAM name="SavePath" default="#ExpandPath("../../Folder")#">

  <CFSET sFileOutput = "">
      <CFFILE Action="Write" File="#SavePath#\#FORM.FixedPageName#"
Output="#sFileOutput#">


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301121
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to