Hi! I'm having trouble with the fsockopen ()-funcion.

When I'm using the code below, the page that is returned is all white. What 
to do? Am I doing anything wrong?

-----
$sp = fsockopen ( "www.php.net", 80,  &$errno, &$errstr, 25 );
if ( !$sp ) {
        die ( $errno . ": " . $errstr );
}
else {
        fputs ( $sp, "POST /page.php HTTP/1.1\n" );
        fputs ( $sp, "Host: www.php.net\n" );
        fputs ( $sp, "Content-Type: application/x-www-form-urlencoded\n" );
        fputs ( $sp, "Content-Length: " . strlen ( $mystr ) . "\n\n" );
        fputs ( $sp, $mystr . "\n" );

        while ( !feof ( $sp ) )
                $str .= fgets ( $sp, 156 );

        fclose ( $sp );
}
-----

PHP Regards,
Björn Wikström
[EMAIL PROTECTED]

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