RE: [PHP] Using the fsockopen ()-function

From: Date: Thu, 24 Jan 2002 22:42:01 +0000
Subject: RE: [PHP] Using the fsockopen ()-function
Groups: php.general 
Request: Send a blank email to php-general+get-81993@lists.php.net to get a copy of this message
>-----Original Message----- >From: Björne [mailto:bjorne@command.nu] >Subject: [PHP] Using the fsockopen ()-function >----- >$sp = fsockopen ( "www.php.net", 80, &$errno, &$errstr, 25 ); if ( !$sp ) { > die ( $errno . ": " . $errstr ); >} >else { > fputs ( $sp, "POST /page.php HTTP/1.1\n" ); This line needs to read: fputs ( $sp, "POST /page.php HTTP/1.0\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 ); >}

« previous php.general (#81993) next »