Re: [PHP] Searching HTML file for tr tags

2001-02-08 Thread Mukul Sabharwal

Hi,

You've forgot to put fread() :

?

$file = fopen('closings.html', 'r');

if (!$file) echo 'Error opening file';
else echo 'got the filebr';

$data = fread($file, filesize('closings.html'));

if
(eregi('trtdStratford/tdtdClosed/td/tr',
$data))

echo 'Stratford closed';

else

echo 'Stratfor open';

?

--- Tyler Longren [EMAIL PROTECTED] wrote: 
Hello everybody,
 
 Here's my code:
 
 ?
 $file = fopen("closings.html", "r");
 
 if (!$file) {
   print "Error getting file";
 }
 else {
   print "Closings.html has been gottenBr";
   if

(eregi("trtdStratford/tdtdClosed/td/tr",$file))
 {
   print "Stratford Closed";
   }
   else {
   print "Stratford Open";
   }
 }
 ?
 
 The file closings.html has tables with weather
 related closings.  I want to
 search closings.html for this line:
 trtdStratford/tdtdClosed/td/tr
 
 If that line is found, it prints "Stratford Closed",
 if it finds that line,
 it prints "Stratford Open".  I'm not sure that the
 file is even open all the
 way.  Thanks everyone!
 
 Regards,
 Tyler
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
[EMAIL PROTECTED]


=
To find out more about me : http://www.geocities.com/mimodit
My bookmarks are available @ http://mukul.free.fr

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Searching HTML file for tr tags

2001-02-08 Thread Tyler Longren

Ah ha!  So i see.  :)

thanks.

-Original Message-
From: Mukul Sabharwal [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 08, 2001 8:21 PM
To: Tyler Longren; [EMAIL PROTECTED]
Subject: Re: [PHP] Searching HTML file for tr tags


Hi,

You've forgot to put fread() :

?

$file = fopen('closings.html', 'r');

if (!$file) echo 'Error opening file';
else echo 'got the filebr';

$data = fread($file, filesize('closings.html'));

if
(eregi('trtdStratford/tdtdClosed/td/tr',
$data))

echo 'Stratford closed';

else

echo 'Stratfor open';

?

--- Tyler Longren [EMAIL PROTECTED] wrote: 
Hello everybody,
 
 Here's my code:
 
 ?
 $file = fopen("closings.html", "r");
 
 if (!$file) {
   print "Error getting file";
 }
 else {
   print "Closings.html has been gottenBr";
   if

(eregi("trtdStratford/tdtdClosed/td/tr",$file))
 {
   print "Stratford Closed";
   }
   else {
   print "Stratford Open";
   }
 }
 ?
 
 The file closings.html has tables with weather
 related closings.  I want to
 search closings.html for this line:
 trtdStratford/tdtdClosed/td/tr
 
 If that line is found, it prints "Stratford Closed",
 if it finds that line,
 it prints "Stratford Open".  I'm not sure that the
 file is even open all the
 way.  Thanks everyone!
 
 Regards,
 Tyler
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
[EMAIL PROTECTED]


=
To find out more about me : http://www.geocities.com/mimodit
My bookmarks are available @ http://mukul.free.fr

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]