It may be returning a negative number which is an error code rather than a
process pointer...
What is $p really?

If it's < 0, use 'man errno' to see what it means.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Tom Hodder <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 14, 2001 1:15 PM
Subject: popen returns true whether script exists or not?


>
>
> Hi,
>
> I'm trying to popen a cgi script that was designed to be open via a SSI
> include, but cannot because of passing variable restrictions.
>
> I'm popening a cgi script and it is returning a process pointer regardless
> of whether the string passed to it points to anything.
> Is this the expected response?
>
> <?
> $p = popen( "/web/guide/myfiles/bannerzzzzz.cgi","r" );
> ?>
>
> this returns a process pointer even though bannerzzzzz.cgi doesn't exist
>
> I then need to read the results of the cgi script and dump them to the
> screen like so;
>
> <?
> while (!feof ($p)) {
>     $buffer = fgets($p, 4096);
>     echo $buffer;
> }
> pclose ($p);
> ?>
>
> but this is not functioning, does anyone have any ideas?
>
> Regards
>
> Tom Hodder
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to