ssi include into worpress 2.01 post (12 posts)

  1. eskboy
    Posted 9 years ago #


    I do i get the following ssi include to show up in a wordpress post

    <!--#include virtual="/cgi-bin/bib/buyitbomb.cgi?keywords=belt&db=17971&mode=all&boundary=word&format=ssi&results=10&start=0&s=1" -->


  2. petit
    Posted 9 years ago #

    For a serverside include to take effect, the page content must be parsed by the web server, so that the include command is caught and the result of your CGI script be included.
    Normally this means that the (X)HTML file would have the file extension .shtml.

    In this case the page is generated by your php pages and the file type ( extension ) is .php, which means no parsing is made by the server, and the include doesn't take effect.

    Your request is rather special, as I found from a somewhat extensive googleing (?). Common sense seem to have it, that the PHP include statement is enough and replaces the SSI functionality.

    AS seen from your problem, that's not entirely true. I'm sure there is a simple solution, but it doesn't strike me just now.

    Good luck!

  3. Kafkaesqui

    Posted 9 years ago #

    Here's how to do SSI in a PHP script:


    Note that if you *must* do this through a post's content, you'll also need one of the "exec php code in a post" plugins:


  4. petit
    Posted 9 years ago #

    Kafkaesqui: Wow!

  5. pizzaman
    Posted 9 years ago #

    You can use this statement in a page template:

    <?php virtual ('/cgi-bin/bib/buyitbomb.cgi?keywords=belt&db=17971&mode=all&boundary=word&format=ssi&results=10&start=0&s=1'); ?>

    No need for a plugin.

  6. Marcomail
    Posted 9 years ago #

    <?php virtual ('/cgi-bin/bib/buyitbomb.cgi?keywords=belt&db=17971&mode=all&boundary=word&format=ssi&results=10&start=0&s=1'); ?>

    not work, don't work virtual in the template files...help me

  7. Marcomail
    Posted 9 years ago #

    anyone ? It's possible virtual function is disable from the hosting ?

  8. Marcomail
    Posted 9 years ago #

    Some ideas ?

  9. It's possible virtual function is disable from the hosting ?

    No, that's not possible, however, why are you trying to use the function from somebody else's question? What exactly are *you* trying to do?

  10. Marcomail
    Posted 9 years ago #

    I run wordpress on dreamhost

    They say run php as CGI and virtual function is not avaible.

    My request is the same of the person. Thanks Otto

  11. techiecoach
    Posted 9 years ago #

    I'm trying to do something similar, except that I want to include ssi in a sidebar template, not a post.

    The regular ssi call statement is:

    <!--#include virtual="cgi-bin/upevent/upevent_full.cgi?Display_Event=Yes" -->

    So, based on the reco above, I've modified it to:

    <?php virtual ('/cgi-bin/upevent/upevent_full.cgi?Display_Event=Yes'); ?>

    Which gives me the following error:

    Fatal error: Call to undefined function: virtual() in /home/techie/public_html/blog/wp-content/themes/Topfade3Col-TW/sidebarR.php on line 7

    Can anyone tell me how to fix the fatal error? I'd be grateful.

    (Or an alternative way to include an upcoming events list that shows only upcoming events (ie, doesn't include events that have passed)


  12. techiecoach: I've since discovered that this function is only available when PHP is being run as an Apache module. So if your host is using PHP as a CGI program, virtual() won't work.

    I use Google Calendar for my events listing on my page, along with a Google Calendar widget I wrote: http://ottodestruct.com/blog/2006/04/18/google-calendar-widget/

Topic Closed

This topic has been closed to new replies.

About this Topic