[thelist] fopen on php failing

Ivo P ipletikosic at gmail.com
Wed Feb 23 16:45:22 CST 2005


seems like it cannot resolve www.chuzpe.us to an address.




On Wed, 23 Feb 2005 20:22:28 +0000, alex <alex at deltatraffic.co.uk> wrote:
> 
> 
> >Where is the variable '$link' being defined? If it is coming from the URL, use
> >$_GET['link'], if it's coming from a POSTED form, use $_POST['link'].
> >
> >
> 
> oh sorry, internally like:
> 
> $link = "http://www.chuzpe.us/index.php" ;
> 
> now all of a sudden, fsockopen is failing:
> 
> *Warning*: fsockopen(): php_network_getaddresses: getaddrinfo failed:
> Name or service not known in
> */usr/local/home/httpd/vhtdocs/delta_000/public_html/regexp/strip2.php*
> on line *5*
> 
> *Warning*: fsockopen(): unable to connect to www.yahoo.com:80 in
> */usr/local/home/httpd/vhtdocs/delta_000/public_html/regexp/strip2.php*
> on line *5*
> Resource temporarily unavailable (11)
> 
> <?php
> 
> $url = "www.yahoo.com";
> 
> $fp = fsockopen("$url", 80, $errno, $errstr, 30);
> if (!$fp) {
>    echo "$errstr ($errno)<br />\n";
> } else {
>    $out = "GET / HTTP/1.1\r\n";
>    $out .= "Host: $url\r\n";
>    $out .= "Connection: Close\r\n\r\n";
> 
>    fwrite($fp, $out);
> 
>    while (!feof($fp)) {
>        $html .=  fgets($fp, 128);
>    }
>    fclose($fp);
> }
> 
> echo strip_tags ($html, "<a>, <i>, <b>, <strong>, <p>, <h1>, <h2>,
> <h3>, <h4>, <title>");
> 
> ?>
> 
> --
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>


More information about the thelist mailing list