Thread: PHP and perl

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    3
    Rep Power
    0
    Hey,

    I am trying to get php to run a cgi script for me and capture the output and echo that back to the screen. Does anyone have any idea how to do this?

    Thanx,
    Big Din K.R.
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>capture the output and echo that back to the screen
    Try fopen.
    Note, your Perl script must accept GET method.

    If you do the other way around or both scripts are in Perl, you can use POST method as well.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    3
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by freebsd:
    >>capture the output and echo that back to the screen
    Try fopen.
    Note, your Perl script must accept GET method.

    If you do the other way around or both scripts are in Perl, you can use POST method as well.
    [/quote]

    Here is what I was using before...

    popen("newsblocks/geeknews/geeknews.cgi", "r");

    Changing to fopen sounds easy, but where or how do I the GET reference?

    Thanx for the feedback as well.
    Big Din K.R.
  6. #4
  7. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>Changing to fopen sounds easy

    Okay.

    >>but where or how do I the GET reference?

    That has to do with your Perl script. If you type the http://www.fullurl.com/to/newsblocks...s/geeknews.cgi to the location box of your browser and get the output of your Perl script, then that's fine. That means your Perl script accepts GET method.

  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    3
    Rep Power
    0
    Hey FreeBSD,

    Thanx for the info. The script does work in that fashion. I was just trying to call it as an include. Found out very fast that all it want's to do in that particular case is just display the script itself. Not good.

    Thanx again,
    bel_dan@linuxrookies.net

IMN logo majestic logo threadwatch logo seochat tools logo