SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Apr 2003
    Location
    Barcelona, Spain
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Include Perl Scripts in PHP Site

    I have a Perl Script that returns an HTML String. How can I include this Script in a PHP Site?

    Thanks for your help!

  2. #2
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    take a peek at virtual()

  3. #3
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just a normal include can work in some cases.
    Mike
    It's not who I am underneath, but what I do that defines me.

  4. #4
    SitePoint Member
    Join Date
    May 2004
    Location
    London, England.
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi there. i'm having issues with this too and i've searched thoroughly an answer so i hope i'm not reapeating things here.

    i've got some buttons which reload the page, add a var which then includes a perl script in place of teh previous one.

    i'm using this in my php:

    include('../cgi-bin/script.pl');

    but the perl script is not executing. i've tested it by direct url so i know the script works ok. but the output is the whole contents of the perl file.

    i've tried using virtual() but that gave me an error.

    any pointers greatly appreciated.

  5. #5
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    give this a try

    PHP Code:
    $url="http://{$_SERVER['HTTP_HOST']}/cgi-bin/script.pl";
    $string=file_get_contents($url); 

  6. #6
    SitePoint Member
    Join Date
    May 2004
    Location
    London, England.
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks frog. i tried it using virtual() again on a different server and it works. must be something to do with my host. i pay them a fortune too.

    sigh. cheers now.


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
  •