Re: [PHP] Re: getting HTML header from URL [solved]

2002-11-01 Thread Jule Slootbeek
yeah i just noticed that myself too,
and unfortunatly people do code their html like that..

J
On Friday, Nov 1, 2002, at 21:44 US/Eastern, David U. wrote:


Jule Slootbeek wrote:

oops didn't catch two little bugs

Jule

function getTitle($url)
{
$file = @fopen($url, 'r');

if(!$file) {
$rline = "Error, contact webmaster";
} else {
while (!feof ($file)) {
  $line = fgets($file);
  if (substr_count(strtoupper("$line"), "") >= 1) {
$rline = strip_tags("$line");
//return $rline;
//fclose($file);
break;
}
 }
 return $rline;
 }
fclose($file);
}


1) What if this line looks like:
foobar
Wont' $rline == "foobar" ?

2) Can't you use a socket and read until the first start saving 
until
the  and close the socket?

-davidu





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


Jule Slootbeek
[EMAIL PROTECTED]


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




[PHP] Re: getting HTML header from URL [solved]

2002-11-01 Thread David U.
Jule Slootbeek wrote:
> oops didn't catch two little bugs
>
> Jule
>
> function getTitle($url)
> {
> $file = @fopen($url, 'r');
>
> if(!$file) {
> $rline = "Error, contact webmaster";
> } else {
> while (!feof ($file)) {
>   $line = fgets($file);
>   if (substr_count(strtoupper("$line"), "") >= 1) {
> $rline = strip_tags("$line");
> //return $rline;
> //fclose($file);
> break;
> }
>  }
>  return $rline;
>  }
> fclose($file);
> }

1) What if this line looks like:
foobar
Wont' $rline == "foobar" ?

2) Can't you use a socket and read until the first start saving until
the  and close the socket?

-davidu





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