Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Including Perl in PHP

    Hello,

    I am trying to call a cgi file from within a PHP file. To do this I am using:

    ---------------
    virtual ('/cgi-bin/test.cgi');
    ---------------

    This works but the code that test.cgi produces is being shown at the top of the page and not in the place were it is being called from!

    The code that test.cgi produces is:
    ---------------
    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="468">
    <TR>
    <TD WIDTH="100%">
    <A HREF="/cgi-bin/click.cgi?account=EL" TARGET="_blank"><IMG SRC="http://www.mydomain.com/images/banner/el.gif" BORDER="0" HEIGHT="60" WIDTH="468" ALT="EL"></A>
    </TD>
    </TR>
    </TABLE>
    ---------------

    Can you help?

    Many thanks,

    Stuart.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Have you tried using "include" instead of "virtual"?

    include ("./cgi-bin/test.cgi");

    just curious.

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,045
    Thanks
    10
    Thanked 93 Times in 91 Posts
    from the manual
    To run the sub-request, all buffers are terminated and flushed to the browser, pending headers are sent too.
    one workaround might be to include('callcgi.php'); where callcgi.php will itself do the virtual() call, not sure if that would work but its worth a try ?
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

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