Running PHP scripts within .cgi files

Sharky Forums


Results 1 to 5 of 5

Thread: Running PHP scripts within .cgi files

  1. #1
    Expensive Sushi
    Join Date
    Apr 2001
    Location
    JHB, South Africa
    Posts
    5

    Question Running PHP scripts within .cgi files

    Hi

    I really hope someone can help me out on this.

    I run a .cgi based forum script, I need to run php scripts from these files. The php scripts are an ad/banner system.

    As far as I know you can only run php scripts from within .php files. Is this true?

    Anyway to run the php scripts in the cgi files? or is it easier to change to a different ad/banner script instead.

    Thanks
    W.

    ------------------
    The Dedicated Computer Music Site.

    http://www.pcmusic.co.za
    The Dedicated Computer Music Site.

    http://www.pcmusic.co.za

  2. #2
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077

    Post

    Yeah you can't have both Perl and PHP read from the same file. The webserver is told what "type" of language to parse based on the file extension. If it's a .cgi or .pl file, than typically it will point to Perl.exe in order to parse all the coding. If it's a .php, .php3, or .php4, than the webserver will refer to the PHP executable.

    It's one or the other, you can't have both! My suggestion would be to look for a different banner rotator, I know of some neat JavaScript ones if you're just looking to display a random banner ad.

  3. #3
    Expensive Sushi
    Join Date
    Apr 2001
    Location
    JHB, South Africa
    Posts
    5

    Post

    Originally posted by Grizzly:
    <snip>

    It's one or the other, you can't have both! My suggestion would be to look for a different banner rotator, I know of some neat JavaScript ones if you're just looking to display a random banner ad.
    Thanks for the answer - it's the best I've got from anybody & this is on numerous baords in numerous countries over the past 3 weeks.

    Depends on what the system is like. I need to have individual logins for all the advertisers & it's gotta allow everything to happen - i.e. stop the ad after a certain date / number of views etc.

    So it can't just be a basic banner displayer.

    - W.



    ------------------
    The Dedicated Computer Music Site.

    http://www.pcmusic.co.za
    The Dedicated Computer Music Site.

    http://www.pcmusic.co.za

  4. #4
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077

    Post

    Ah I see what you mean, sounds like a pretty sophisticated PHP script there. So why exactly are you facing the wall of needing to execute this PHP banner-thingy in a CGI file? What needs to be done in CGI, that can't be done in PHP? PHP is pretty robust as far as web languages go, I'm sure we can cook up something for you to replace whatever Perl you're trying to run.

  5. #5
    Expensive Sushi
    Join Date
    Apr 2001
    Location
    JHB, South Africa
    Posts
    5

    Post

    Okay, the forum is a cgi forum. The banner script we were using is called phpads - has some really great functionality for a freeware product. URL = http://phpwizard.net/projects/phpAds/

    Unfortunately since I can't run php within the cgi, I need to find an alternative banner script - yet one which has the functionality of quite a highend product(incl. the stuff I've mentioned above) & if possible freeware - I'm pretty sure there is something, I just haven't come across it.

    Thanks
    W.

    ------------------
    The Dedicated Computer Music Site.

    http://www.pcmusic.co.za
    The Dedicated Computer Music Site.

    http://www.pcmusic.co.za

Posting Permissions

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