Just PHP on Page. Should I Still Add DOCTYPE, HTML Tags, etc.?

Discussion in 'PHP' started by Masterful, Sep 30, 2008.

  1. #1
    Say I had a page with no visible content, just a PHP code, meant for a particular PHP task. Should I still give that page a DOCTYPE, META tags, HTML tags, etc.? Or, is it OK if the page contained just the PHP code?
     
    Masterful, Sep 30, 2008 IP
  2. cornetofreak

    cornetofreak Peon

    Messages:
    170
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2

    if you are writing a back end file such as a class file or a function file that only contains variables, functions etc.. then no but if its a file like index.php where the file will be visable to web users then yes,

    basically the files that you are letting your users go to should contain html and meta data..

    hope this helps
     
    cornetofreak, Sep 30, 2008 IP
    Masterful likes this.
  3. Masterful

    Masterful Well-Known Member

    Messages:
    1,653
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    140
    #3
    I know that, dude. I meant pages that will not be seen, which you also answered.

    Thanks! I've added reputation points to your account. :)
     
    Masterful, Sep 30, 2008 IP