Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2006
    Thanked 0 Times in 0 Posts

    .dat and .txt files

    Is there any difference when including a .dat or .txt file?
    I havent seen any difference with its effectiveness, both can store content and print, besides .dat looks like a cooler extention to organize files - is there any gain?

  2. #2
    Regular Coder
    Join Date
    May 2007
    Thanked 0 Times in 0 Posts
    In fact the .dat file can be just .txt file with .dat extension but originally text files .txt consist of lines terminated with a CR/LF (#13#10) combination (or just LF Unix/Linux or CR Mac), and typed files .dat consist of data taken from a particular type of data structure.
    Forum for webmasters and developers
    Are you an IT expert? Join our Reward system

  3. #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 932 Times in 919 Posts
    A .dat file can contain ANYTHING depending on which program it is intended to be used with. In most cases it will not contain readable text or if it does there will usually be non readable portions as well.
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  4. #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Denver, Colorado USA
    Thanked 511 Times in 499 Posts
    Even though you posted this in the HTML forum section, I assume that you are talking about using PHP to include these?

    A word of caution about putting PHP code (including PHP variable and constant define(...) statements) in files that do not have a .php extension. If you put PHP code/variable/define statements in files that have a .htm, .html, .txt, .dat, .inc, ... or any other extension that is not parsed by the PHP language engine, then anyone that learns or guesses the file name can directly browse (or use a script) to your file and see the exact contents of that file. Only put PHP code/variable/define statements in a .php file (or an alternate extension that you have setup on your server to be parsed as PHP code.)
    Finding out HOW to do something is called research, i.e. keep searching until you find the answer. After you attempt to do something and cannot solve a problem with it yourself, would be when you ask others for help.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts