[thelist] fopen on php failing
alex
alex at deltatraffic.co.uk
Wed Feb 23 12:37:05 CST 2005
>Have they upgraded PHP? Is SAFE MODE on? Have the file permissions
>changed?
>
>
safe mode is off. ver 4.3.8 - should be able to handle fopen? file
permissions seems not to do much.
however .. I tried this:
<?php
$url = "www.schnews.org.uk";
$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>");
?>
More information about the thelist
mailing list