SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: PHP and SSI

  1. #1
    SitePoint Member
    Join Date
    Jun 2000
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey All,

    I'm currently trying to get a ad rotator (a very simple one) working on my page. My page uses PHP to display its content but the script i'm installing uses SSI to display its output.. the readme file says I should use this code:

    <!--#exec cgi="/cgi-bin/ads.cgi" -->

    Which would be fine if I was using SSI. But I need php3 to do the same thing.

    I've tried just doing:
    include("/cgi-bin/ads.cgi");
    and
    include(/server/path/to/cgi-bin/ads.cgi);

    But they didn't work. I thought about using exec but i'm not sure how that works.

    Any help is welcome, Thanks,

    -Matt


    ------------------
    -----
    ComicalPics.com

  2. #2
    exit();
    Join Date
    Jul 2000
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could always go with another sort of script.

    If you have PHP and mySQL try out phpAds at http://www.phpwizard.net

    If you want a Perl and mySQL solution, I HIGHLY recommend AdCycle at http://www.AdCycle.com

    For any other Perl, ASP, PHP scripts etc check out http://www.hotscripts.com

    ------------------
    ICQ Me! (73902680)

  3. #3
    SitePoint Member
    Join Date
    Jun 2000
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd love to have those scripts, i've looked at them for a while now.. but I don't have my_sql :P

    Thanks,


    -Matt

    ------------------
    -----
    ComicalPics.com

  4. #4
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I have an idea..

    You wouldn't be able to use any HTTP %ENVs in your perl script if you did this, but you could run the command 'perl SCRIPTNAME.cgi' from the command line. I believe this is done with the system() PHP function.

    $scriptoutput = system('perl '.$FILENAME_OF_PERL_SCRIPT);

    You'll want to check the perl script location variable so no one can run commands you don't want them to.

    Other than that, I'm pretty sure that would work but you might want to test it a bit.

  5. #5
    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)
    If PHP is compiled as a Apache module you can use the virtual funtion it should do the job for you.

    If not then their is a thread elsewhere on the topic of PHP and SSI on this forum, just search for PHP and SSI.

    ------------------
    Karl Austin
    KDA Web Services
    "Everyone has a photographic memory. Some just don't have film."

  6. #6
    SitePoint Member
    Join Date
    Jun 2000
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Virtual() works like a charm! Thanks!

    -Matt

    ------------------
    -----
    ComicalPics.com


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
  •