webishqiptar 0 Report post Posted May 31, 2009 I am not sure, but databases are good because you can export them to different cpanels. Then flat files are not so popular, and so you have to invent by yourself lots of things, You need to be a good coder. Share this post Link to post Share on other sites
k_nitin_r 8 Report post Posted June 3, 2009 (edited) Hi!My concern with flat files is write-concurrency. They offer good performance while reading though and if your file is your actual end markup, the web server can serve the file without any processing! WP-SuperCache does something similar for WordPress blogs.Regards,Nitin Reddy"Flat flies good. Flat files bad." (kidding!) Edited June 6, 2009 by k_nitin_r (see edit history) Share this post Link to post Share on other sites
Dave Morton 0 Report post Posted June 9, 2009 I use a mixture of both flat files (in the form of static includes, for page formatting) and database (for, of all things, my error page, which uses detailed database info for reporting specifically on every error), depending on the criteria required. In my opinion, it's like comparing a pair of pliers to a wrench. You can use pliers (flat files) as a wrench (database), but it's clunky, and not the best tool for the job, most times. conversely, you can also use a wrench to do the same job that pliers do, at times, but it can be unwieldy to do. My main criteria is how static the data is, and if it's page structure (presentation) or data of some sort (content). It also depends on how hard it would be to code which way, and how lazy I'm feeling at the time. Share this post Link to post Share on other sites
Wang 0 Report post Posted June 14, 2009 No, they are a bad idea! Share this post Link to post Share on other sites
k_nitin_r 8 Report post Posted June 14, 2009 Hi!I like the way Dave Morton puts it - you need to use what's best for the scenario at hand. If you've got heavy traffic on your website, using a database call several dozen times on a single page isn't really a good idea.For data that rarely changes, if you can put together the data you need and write it to an HTML file on disk, you can use the static HTMLpages for the header and footer (with frames) - that would save you quite a bit of processing. Or you could just call a PHP script via AJAX on a static HTML page for the dynamic content while the less-frequently changing content is already written to the page.For images, instead of storing the actual binary data in the database, you can store the file on disk and keep just the file name in the database. It saves you a lot of processing too.Regards,Nitin Reddy Share this post Link to post Share on other sites
TheDarkHacker 0 Report post Posted November 7, 2009 This kind of files are really good way to store lots of data,but if they are not important.Because if you store passwords in files,hackers will find out the file and only a half step is separating them from hacking your website or stealing someones password.The half step is decrypting which is possible if you only use md5 to encrypt passwords.You should always use more complicated way to encrypt passwords if you use flat files.Flat files for example are very good for logs.I have a little script which is storing everyone's IP and time he visited my website,and all that data is stored in one file which i can see.If you use flat files for passwords i cannot give you the principe i use this principe to encrypt passwords: function enc($string){$second=sha1($string);$third=str_replace("a","z",$second);return md5($third);}So this code first encrypts string in sha1,then it replaces a with z,to make hash not decryptable,then it is encrypting the sha1 hash with md5 method.So this will always return the same result,and that is why this function will work...If you do not believe me,try to add this code in php page and refresh and you will always see the same vode.So you need to use this to check is the password correct:if(enc(the password user specified)==enc(the password which should be){ the code should be executed } Remember that you need to replace bold things with real variables or code.Flat files are better if you need to do some operation fast,without any complicate code and without errors.Remember,FLAT FILES SHOULD NOT BE USED FOR THINGS LIKE PASSWORDS IF THEY ARE NOT SECURED Share this post Link to post Share on other sites
T X 0 Report post Posted March 27, 2010 I use it for programming my own databases in JPL but definitely not for web hosting, very bad idea. Share this post Link to post Share on other sites