Bluehost.com Web Hosting $6.95

Include() with cgi problems

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-05-2005
vincenzo.bacarella@gmail.com
 
Posts: n/a
Default Include() with cgi problems

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

Reply With Quote
  #2 (permalink)  
Old 11-05-2005
Kimmo Laine
 
Posts: n/a
Default Re: Include() with cgi problems

<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>


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:24 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0