![]() |
|
|
|||||||
![]() |
PERL - HTML Templates stored in Postgres using Perl |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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. |
|
|
|
#3 |
|
Posts: n/a
|
(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 |
|