Bug #1241: fgets and fgetss don't work
| From: | empgmma at brunel dot ac dot uk | Date: | Wed, 17 Mar 1999 13:47:28 +0000 |
| Subject: | Bug #1241: fgets and fgetss don't work | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-4663@lists.php.net to get a copy of this message | ||
From: empgmma@brunel.ac.uk
Operating system: Linux (Redhat 5.2)
PHP version: 3.0.7
PHP Bug Type: Misbehaving function
Bug description: fgets and fgetss don't work
I am trying to download a file and strip the HTML code from it. I tried a straight fgetss after
fopen and it returned an empty string. So I tried caching the file and that didn't work either.
Another thing, I think it would be a good idea to allow openning wrappers through a proxy server.
The service ports are blocked on my machine and everything has to go through a proxy server!
Failing that.. what commands do I need to type if I open a socket with my proxy server (for
downloading an HTML file)
<FORM ACTION="<?echo $PHP_SELF?>" METHOD="POST">
<p>ENTER URL:<INPUT TYPE="text" NAME="url" value="http://">
<input type=submit value="Convert">
<input type=reset>
<?
if (isset($url)){
$text = file($url);
$size = sizeof($text);
$name = tempnam("/home/httpd/html/temp", "dnload");
$fp = fopen($name, "w");
if (!fp){
echo "error, Cannot open $name<br>";
}else{
for ($x = 0; $x < $size; $x++){
echo $text[$x];
fwrite($fp, $text[$x]);
}
rewind($fp); $size = filesize($name);
echo "size = $size<br>";
$text2 = fgetss($fp, $size);
echo "text = \"$text2\"";
fclose($fp);
unlink($name);
}
}
?>
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net