Results 1 to 6 of 6

Thread: Execute a CGI script through PHP

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2003
    Posts
    126

    Execute a CGI script through PHP

    How can I execute a CGI script through PHP? PHP doesn't like this at all:

    <!--#exec cgi="/cgi-bin/poll/fantasycricket.pl" -->

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    PHP Code:
    <?php include "/cgi-bin/poll/fantasycricket.pl" ?>
    or

    PHP Code:
    <?php virtual("/cgi-bin/poll/fantasycricket.pl" ?>
    HTH

  3. #3
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629
    PHP doesn't like that because that's SSI.. I don't really know why; but I laughed when I read it..
    Like Archer? Check out some Sterling Archer quotes.

  4. #4
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I laugh when I read every post. Bwah-ha-ha!
    My evil laugh has a squeak in it.

    kristopherwilson.com

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    The PHP in my post is missing the ) and the ;

    That makes it twice as funny.

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    include does a raw text include, so that won't work.

    You could use fopen to send a HTTP request to the CGI script and simply write out the results.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

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



Click Here to Expand Forum to Full Width