Gossamer Forum
Home : Products : DBMan : Customization :

How Export html generated code of database to a text file help

Quote Reply
How Export html generated code of database to a text file help
What I want is to export the html code that gets generated by say the html.pl files... the reason being is I created header.pl files but what i found out is that you have to load the database to get those html files that are created by the .pl files... but that can be very slow and esp when i have more then one database definded... it would have 3 of them which i use... just to display a few feilds out of the rest that i have...

I have about say 20 different feilds/types and i use for my main html.pl only to display the general info

then i have a detail.pl that displays all the feilds for that record...

I then have on the front page header.pl files which just show about the first 5 most resent records with only 2 or so feilds being displayed...

as you can see this can be very slow but with a file that is generated into text just taking those 5 records and puting them in a text file i can then just use ssi to read in that text... which would be very fast and in a similar way to how say newspro does the news... it places the html that is displayed in a .txt and the server just loads that file and doesnt have to execute the cgi... it only needs to execute the cgi when some changes are made to it...

I tried to look at the mod sections but I dont understand which one would work for me... maybe someone can help me out fast :) and im sure this will help others too
Quote Reply
Re: [drutort] How Export html generated code of database to a text file help In reply to
also for some people im sure it would be nice to say append to the text file...

but in my case I just need to over ride it... and make a new one any time there are some changes to the database... so i always have the current say 5 records in a text file and no more...
Quote Reply
Re: [drutort] How Export html generated code of database to a text file help In reply to
Hi,

What you need sounds like the build function of link

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] How Export html generated code of database to a text file help In reply to
what do you mean?

I dont understand heh

I can give you a site and show you why I would really like to have it in a txt or html format or something instead of having to execute the cgi every time on page load...

ssi would be so much faster...

look at this site...

http://wind.prohosting.com/~3lite/

and im sure once the databases grow it will slow down... I dont know it might be that server??
Quote Reply
Re: [drutort] How Export html generated code of database to a text file help In reply to
I see. This can be done

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [drutort] How Export html generated code of database to a text file help In reply to
In the FAQ under the section "SSI" there is a thread called "Latest Headlines (SSI)". I think this may provide what you need.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] How Export html generated code of database to a text file help In reply to
yes, ok i was looking at some of the ssi stuff, not sure if it was the same but how they were doing was just adding some function in the cgi to support or to out put in ssi...

the problem is I dont want that I want another script or something within the cgi to export to a text file the viewed html that the .pl files generate thats all then I can call on the generated text files with ssi and that will just go say into a table or whatever... it would be very fast instead of having to load the cgi script and look through the db and do what it does ;)

much faster im sure of that.. and newspro uses the same idea but just spits out a txt file of what is viewed with html...

I wouldnt mid the html but i could at least use the export to text file what is seen or outputed from the .pl file and nothing more just the pure text values of the feilds... dont need the html if you plan to insert it with ssi into already made web page...


and i looked at that Latest Headlines (SSI MOD) but it still calls on the cgi!! i dont want that you see? <!--#exec cmd="/path/to/headlines.cgi"--> i dont want to exec the cgi that is slow vs just a generated small text file, come on someone should have thought of this long ago

Last edited by:

drutort: Apr 19, 2002, 6:56 PM
Quote Reply
Re: [drutort] How Export html generated code of database to a text file help In reply to
ok you know how in the pl files you have the sub html_record that is what is displaying the records with the html...

well all i want is to take my header.pl which is already formated right just want i need to display in the html_record to be exported/saved to a text file

just the some other info that i want like say Name and then the feild_name along with that... maybe even option to out put directly the html_record to a file...

I hope that helps define more what I would like to see...

this could work well also with any .pl file as you can have much faster out put then loading a cgi... just call ssi and display the text... this is good for viewing stuff to the public many times over... without having to execute the cgi every time... only the text file gets updated when anything gets changed in that database...

I would think its not that hard to code it.. if i would know perl :|
Quote Reply
Re: [drutort] How Export html generated code of database to a text file help In reply to
I've never had problems with it being slow to run DBMan as is even with large databases, and it can be setup to blend into your site so it's not even obvious it's a database, but I think i know what you want to do.

What you want is an external script of some kind to just read the database and display the database within tables on a static page? If so check out this url:

http://www.technotrade.com/table/table.html

This was something I used before I discovered DBMan.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] How Export html generated code of database to a text file help In reply to
nope thats not what i need,

can someone just make a script/MOD that takes the .pl html code and only extract the feilds and maybe some extra text into a file, and save it, thats all im saying a text file of the feilds that are generated by the .pl
Quote Reply
Re: [drutort] How Export html generated code of database to a text file help In reply to
Search for 'sub html_printout' this will via a search form choose all records and extract the specified fields into a delimited text file.

The mod if available in the FAQ under "Files" and called "Output fields to a text file". It should also be listed under mods.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [drutort] How Export html generated code of database to a text file help In reply to
This is just what I am trying to do, and asking in a different thread.

I want to generate a file, formatted as html, containing the Input data from a submission to the database.

Currently it is possible to re-write an existing file on the server, but I need, as this poster does, to write a new and unique file (i.e. with a unique name related to the User, or the record ID) containing the data, formatted as html.

I then want DBMan to email that file to the submitter of the data.

Anybody have a clue as to exactly how to do it? My attempts so far have failed.

It would make a great MOD!



-------------
David Olley
Anglo & Foreign International Limited,
http://www.firehelmets.co.uk

There are 10 types of people in the world: those who understand binary, and those who don't.
Quote Reply
Re: [davidolley] How Export html generated code of database to a text file help In reply to
Just to keep this thread up to date, I have managed to create an html file on the server, containing the selected data from the database. I am now having some problems with Server Errors, however.

For what it's worth, you can get the code at http://www.lakelandoffshore.com/...html_add_success.txt

Remember to CHMOD the public directory where the file is written to 777.





-------------
David Olley
Anglo & Foreign International Limited,
http://www.firehelmets.co.uk

There are 10 types of people in the world: those who understand binary, and those who don't.

Last edited by:

davidolley: Apr 23, 2002, 3:53 PM
Quote Reply
Re: [davidolley] How Export html generated code of database to a text file help In reply to
Now it is finally cracked, the full file is at http://www.lakelandoffshore.com/...d_send_email_mod.txt

Some may find it useful.
-------------
David Olley
Anglo & Foreign International Limited,
http://www.firehelmets.co.uk

There are 10 types of people in the world: those who understand binary, and those who don't.