This is a discussion on Include() with cgi problems within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Dear friends, I have a big problem. With an usersonline script I need to extract in php the output of ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Dear friends,
I have a big problem. With an usersonline script I need to extract in php the output of a cgi using buffering output in this way: <?php ob_start(); include('/home/mysite/public_html/cgi-bin/usersonline/online.cgi'); $contents = ob_get_contents(); ob_end_clean(); echo $contents; ?> In this way the code of the cgi is displayed, not executed. Why? I need to execute and catch the output in this way...with include('http://www.mysite.com/cgi-bin/usersonline/online.cgi') works well but the requestes come with the same ip (my server) and this is not the results which I want. Thanks, Vincenzo, Rome, IT |
|
|||
|
<vincenzo.bacarella@gmail.com> kirjoitti
viestissä:1131149193.259437.141160@g47g2000cwa.goo glegroups.com... > Dear friends, > > I have a big problem. With an usersonline script I need to extract in > php the output of a cgi using buffering output in this way: > > <?php > ob_start(); > include('/home/mysite/public_html/cgi-bin/usersonline/online.cgi'); > $contents = ob_get_contents(); > ob_end_clean(); > echo $contents; > ?> > > In this way the code of the cgi is displayed, not executed. Why? I need > to execute and catch the output in this way...with > include('http://www.mysite.com/cgi-bin/usersonline/online.cgi') works > well but the requestes come with the same ip (my server) and this is > not the results which I want. The thing is that php executes only php code. if you include some other language, it won't execute it. Hence including the code in this case doesn't work. And while reguesting it from the server did work, like you mentioned, it does make the caller of the script the server and no the user. That's a tricky situation and I see no other solutions than to modify the users online script, if you can. -- SETI @ Home - Donate your cpu's idle time to science. Further reading at <http://setiweb.ssl.berkeley.edu/> Kimmo Laine <antaatulla.sikanautaa@gmail.com.NOSPAM.invalid> |