SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I was wondering if anyone could clarify which of the Include, virtual and passthrough function to use for certain situations.

    I have 3 situations where I which to perform SSI type functions:

    1/. to include plain html or txt files which require no further processing.

    2/. to include php files with the php code embeded within the html.

    3/. to include files which are first passed through a perl script (currently done by <!--#include virtual="/cgi-bin/apexec.pl?template=humour/index.htm" -->)


    I guess the best method for situation 1 is use passthrough, but I would be grateful if someone knowledgable could set me straight.

    I would also be interested to know if their are any caviats with any of these methods.

    Cheers in advance.


  2. #2
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For 1 & 2 you can either use include() or require()

    don't forget to put <?php ?> around the PHP code in the includes by 2!

    I'm not certain about 3, since I've never used that kind of includes.

    Hope this helps
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  3. #3
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers, I've used passthrough in a script I've created and from what I can see it seems to be the optimum way of just outputting html from another files - as it just outputs it straight - so I guess it uses v.little processing power.

    However, what do I know!

  4. #4
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    passthru() would be good for 3:

    http://www.php.net/manual/en/function.passthru.php

    For 1 and 2 you'll better use include/require() since those are the real "straight output" commands.
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  5. #5
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry - got my functions mixed up

    I meant fpassthru()

    I'm even more confused now!

  6. #6
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    fpassthru:

    http://www.php.net/manual/en/function.fpassthru.php


    I think that since you already use <!--#include virtual=""--> for 3, you can use include()/require() for 1,2 and 3.
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.


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
  •