[PHP] Re: fsockopen() prob

2001-11-29 Thread Yura

Nop, doesn't work - the same result, supplied argument is not valid 
file handler...

Youri

> Global variables are not really global in php because they are not
> available from within functions unless you specifically declare them
> as global.  This should work:
> 
> 130   function get_line {
> 131   global $socket_open;
> 132   $buffer = fgets($socket_open,500);
> 133   $buffer = eregi_replace("(\r|\n)","",$buffer);
> 134   return $buffer;
> 135   }
> 
> Fred
> 
> Yura <[EMAIL PROTECTED]> wrote in message
> 3C054EE3.19234.2726172@localhost">news:3C054EE3.19234.2726172@localhost...
> > I have a global variable
> > $socket_open = fsockopen($pop_server, 110,  $errno, $errstr, 60 );
> > then I define the function:
> >
> > 130   function get_line {
> > 131   $buffer = fgets($socket_open,500);
> > 132   $buffer = eregi_replace("(\r|\n)","",$buffer);
> > 133   return $buffer;
> > 134   }
> >
> > Here I've got the prob - it doesn't work, it sais: Warning: Supplied
> argument is not a valid File-
> > Handle resource in .../inc/pop-functions.inc on line 131
> >
> > At the same time $socket_open returns "Resource id #2" I don't know
> > what
> it means, could
> > anyone help me with it?
> >
> > Youri
> >
> >
> >
> >
> > <>< <>< <>< <>< God is our provider ><> ><> ><> ><>
> > http://www.body-builders.org
> >
> >
> 
> 
> 

<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org



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




[PHP] Re: fsockopen() prob

2001-11-28 Thread Fred

Global variables are not really global in php because they are not available
from within functions unless you specifically declare them as global.  This
should work:

130   function get_line {
131   global $socket_open;
132   $buffer = fgets($socket_open,500);
133   $buffer = eregi_replace("(\r|\n)","",$buffer);
134   return $buffer;
135   }

Fred

Yura <[EMAIL PROTECTED]> wrote in message
3C054EE3.19234.2726172@localhost">news:3C054EE3.19234.2726172@localhost...
> I have a global variable
> $socket_open = fsockopen($pop_server, 110,  $errno, $errstr, 60 );
> then I define the function:
>
> 130   function get_line {
> 131   $buffer = fgets($socket_open,500);
> 132   $buffer = eregi_replace("(\r|\n)","",$buffer);
> 133   return $buffer;
> 134   }
>
> Here I've got the prob - it doesn't work, it sais: Warning: Supplied
argument is not a valid File-
> Handle resource in .../inc/pop-functions.inc on line 131
>
> At the same time $socket_open returns "Resource id #2" I don't know what
it means, could
> anyone help me with it?
>
> Youri
>
>
>
>
> <>< <>< <>< <>< God is our provider ><> ><> ><> ><>
> http://www.body-builders.org
>
>



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