SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Sep 1999
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please explain the include function of php in detail
    What kind of documents can be included in the include function
    Txt is ok can we include html documents
    <? include("abc.htm)" ?>
    Can we include another php fine in it
    <? include("abc.php)" ?>

    Thanks


  2. #2
    RAGE
    SitePoint Community Guest
    first thing is first.. your syntax there is wrong.. it goes

    <? include("abc.txt"); ?>

    and yes, you can include, txt, html, php, etc.... basically, included files will put the text in any file INTO the file you are including to .. if you include a php file, and there are php tags in the file, it will work fine ....

    later...

    ------------------
    Vinay Sahni, Coder .. specializing in php/mysql
    vinay@kryogen.com

    http://www.realmz.net - your #1 source of Webmaster Resources (web-building)
    http://www.kryogen.com - when you want something more (web-hosting)
    http://www.kryoscripts.com - we build the future (web-scripting)

  3. #3
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Really most people use the syntax as:

    <?php include "file.inc"; ?>

    As it is slightly tidier as well as XML compliant and i believe it is also slightly faster - This is just me being picky, but hey I'm just like most other programmers who want to squeeze every last millisecond out of there code.

    ------------------
    Karl Austin
    KTech Design Associates - No URL Because It's Not Finished


Bookmarks

Posting Permissions

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