Include for a php.cgi? (Strato.de)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dirk Grutzmacher

    Include for a php.cgi? (Strato.de)

    Hi there,

    My provider (strato.de) offers me this cgi, which contains some php
    elements as far as I guess. I am running my page with php and would
    like to include in the over all design the formmanager (contact page)
    However, I cannot include it from inside a page

    Here is the code I use (without the // obviously)

    // <?php
    // include("/cgi-bin/formmanager.php .cgi?action=ext _preview&fid=2" );
    // ?>


    The error reported is:

    Warning: main($/cgi-bin/formmanager.php .cgi?action=ext _preview&fid=2) :
    failed to open stream: No such file or directory in
    /mnt/am2/02/236/00000005/htdocs/ic-cms/kontakt.php on line 31

    Warning: main(): Failed opening
    '$/cgi-bin/formmanager.php .cgi?action=ext _preview&fid=2' for inclusion
    (include_path=' .:/opt/RZphp4/includes') in
    /mnt/am2/02/236/00000005/htdocs/ic-cms/kontakt.php on line 31

    Can any one help, the help desk at Strato is not particularly helpful
  • Janwillem Borleffs

    #2
    Re: Include for a php.cgi? (Strato.de)

    Dirk Grutzmacher wrote:[color=blue]
    > // <?php
    > // include("/cgi-bin/formmanager.php .cgi?action=ext _preview&fid=2" );
    > // ?>
    >[/color]

    when including a file, PHP expects the given argument to be the actual file
    name and location.

    So, in your case, a file with a name matching the argument should exist:

    /cgi-bin/formmanager.php .cgi?action=ext _preview&fid=2

    To solve your problem, there are two options:

    1. Use HTTP to call the script (can be done with include when the url_open
    wrappers allow it, or use file/file_get_conten ts/fsockopen/curl instead)
    2. Use system call functions like exec() to invoke the script with command
    line arguments, e.g.:

    exec("/cgi-bin/formmanager.php .cgi action=ext_prev iew fid=2");

    Of course, the script should then be capable of parsing the command line
    arguments.


    JW



    Comment

    Working...