On 7/28/07, Ed Grimm <[EMAIL PROTECTED]> wrote: > The way you word this seems to me ambiguous. Are you needing assistance > in how to do the two options I mentioned?
I'm not sure how I can articulate it clearer. I have a working embperl based website with lots of included epl files that build page templates, etc. Every subsequent html file contains text/code which sits inside each page template which is automatically generated and then served. What I want to do for ONE particular page is have it generate a file that can be downloaded. Now, the user visits the particular html page (which is rendered with all the templates), fills in some details, clicks submit (which is a FORM action back to the same page) and then the HTTP response is the file to download. Now, this can be easily achieved by some [$if defined..] statements to check if the form variables have been filled in and then response back the the file to download. The problem is that the file download would include the HTML templates that are provided as part of base.epl, etc thus making the file download littered with HTML garbage. Now, I could circumvent that by placing it all in a new directory and have a null base.epl however that does not solve my problem because I want the templates rendered in the first place when the form variables need to be specified! So if that's not clear enough, here's some pseudocode: $ cat generate.html [$if !defined(form variables)$] <!-- stuff in base.epl with Execute, etc will be automaticall included here --> Text: <FORM ACTION="generate.html"> .... </FORM> Text <!-- and here --> [$else$] call_some_function_that_prevents_any_templates_from_being_processed(); [- # perl to generate the file. $header{'content_type'} = 'text/text'; print OUT ... -] [$endif] Is that at all possible with Embperl? Thanks. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]