HTML Templates stored in Postgres using Perl

Discussion in 'Perl' started by Sam, Jul 9, 2003.

  1. Sam

    Sam Guest

    I would like to store html templates in a database. By using perl I
    would like to retrive the template ask the user to fill the template
    and store the whole file is template + the user data in a database.
    How can I do this? Should I use Perl Mason to do this.

    Or Can I store the template in database using text field and then
    retrive the template from database using select command and then save
    the html template to a file. Then in form action give the template
    file name. The template will be displayed. Then ask the user enter the
    values and by some method insert the user values in the template and
    store the whole file in the database.

    Can anyone suggest suitable methods for doing this.
    Sam, Jul 9, 2003
    #1
    1. Advertising

  2. Sam

    Sam Guest

    Actually I have to give the user to choose different templates, styles
    and files. For each templates there are different styles stored in the
    database. I have to store not only the values the user entered but the
    whole form in the database for retrival. Suppose the user wants to see
    the file he just created. Then he can give the filename and view the
    results. I have done this using Perl DBI for storing the user entered
    values in the tables. But Now I am trying to create seperate html
    templates and store it in the database.



    wgu_@_wurquhart.co.uk (Wm. G. Urquhart) wrote in message news:<>...
    > (Sam) writes:
    >
    > > I would like to store html templates in a database. By using perl I
    > > would like to retrive the template ask the user to fill the template
    > > and store the whole file is template + the user data in a database.
    > > How can I do this? Should I use Perl Mason to do this.

    >
    > You can do this using just Perl and the DBI.
    >
    > > Or Can I store the template in database using text field and then
    > > retrive the template from database using select command and then save
    > > the html template to a file. Then in form action give the template
    > > file name. The template will be displayed. Then ask the user enter the
    > > values and by some method insert the user values in the template and
    > > store the whole file in the database.
    > >
    > > Can anyone suggest suitable methods for doing this.

    >
    > Why would you want to store a copy of the template for every submission?
    > IMHO, it would be better to create a table or tables to store the result
    > of the posting. You'd have much greater control over the analysis of the
    > results.
    Sam, Jul 9, 2003
    #2
    1. Advertising

  3. (Sam) writes:

    > Actually I have to give the user to choose different templates, styles
    > and files. For each templates there are different styles stored in the
    > database. I have to store not only the values the user entered but the
    > whole form in the database for retrival. Suppose the user wants to see
    > the file he just created. Then he can give the filename and view the
    > results. I have done this using Perl DBI for storing the user entered
    > values in the tables. But Now I am trying to create seperate html
    > templates and store it in the database.
    >

    Please don't top post. If you don't know what it is then find out
    before you reply please.

    Ok, I assume when you say templates you are referring to an HTML form
    template? Again I'm assuming here that you mean a style to be a
    CSS. But what do you mean by files?

    If you are doing what I think you are doing I'd be inclined to use
    cookies to store the users prefs. If cookies aren't an option do the
    users of the system have to login? If they do then you can store the
    users' prefs in the DB, and retrieve them at login.

    Also, storing the templates in the DB is quite redundant since you
    have the overhead of getting it out. It would be easier and quicker if
    you stored them on the FS.

    --
    Regards,

    William
    s/_//g to reply
    Wm. G. Urquhart, Jul 10, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Harrison

    using templates in templates

    John Harrison, Jul 31, 2003, in forum: C++
    Replies:
    8
    Views:
    376
    Torsten Curdt
    Jul 31, 2003
  2. JKop
    Replies:
    3
    Views:
    454
  3. recover
    Replies:
    2
    Views:
    789
    recover
    Jul 25, 2006
  4. Nick Black
    Replies:
    1
    Views:
    146
    Kashia Buch
    Nov 16, 2006
  5. C. Olive
    Replies:
    1
    Views:
    247
    Chris Smith
    Oct 4, 2003
Loading...

Share This Page