Throw out everything untill you get second empty line

Phil Powell wrote:

>If you go to http://valsignalandet.com/feedback.php you can get a clearer indication 
>of what I am trying to get rid of.  Following is my function using to produce the 
>stuff up there, which I don't want, instead, I either want cookie-driven information 
>or nothing (if no cookie is set):
>
>function WebGet($address, $port = 80, $url = '/', $post = false, $cookie = false) {
>   // Use fsockopen to catch the URL 
>   $fp = fsockopen ( $address, $port);
>
>   // Zero Fill 
>   $ret = '';
>
>   if ($fp) {
>      // Success.  Now check to see the type of request 
>      if ($post) {
>         $request = "POST $url HTTP/1.1\n";
>         $request .= "Host: $address\n";
>         $request .= "Content-Length: " . strlen( $post ). "\n";
>         $request .= "Content-Type: application/x-www-form-urlencoded\n";
>
>         if ($cookie) $request .= "Cookie: $cookie\n";
>
>         $request .= "Connection: Close\n\n";
>         $request .= $post;
>      } else {
>         $request = "GET $url HTTP/1.1\n";
>         $request .= "Host: $address\n";
>         $request .= "Content-Type: text/html\n";
>
>         if ($cookie) $request .= "Cookie: $cookie\n";
>
>         $request .= "Connection: Close\n\n";
>      }
>
>      $ret = '';
>
>      // Write the Request 
>      fputs ($fp, $request);
>
>      // Get the response 
>      while (!feof($fp)) $ret .= fgets ( $fp, 128 );
>
>      // close the connection 
>      fclose ($fp);
>   }
>
>   return $ret;
>
> }
>
>I do not want to change WebGet as I wish to keep it a universal function that can be 
>used for cookies or not.
>
>So, how can I get rid of the trash on my page?
>
>Thanx
>Phil
>
>  
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to