Thanks for the script. I've tried it and it works great with other web
pages, but still doesn't seem to work with the particular page that I need.
When I run the script this is the output that I get. I need the missing data
within the <textarea> tags:
HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Tue, 12 Aug 2003 04:24:15
GMT Content-Type: text/html <html> <head> <title>Map 1 Upper Cañada del Oro
sensors</title> </head> <body> <body background=/DWGraphics/DWBG.jpg> <div
align=Center><font size=+2
color=#551a8b><big><big><big><big><big><big><big>< big><big><big><big><big><b
ig><big><big> Map 1 Upper Cañada del Oro
Sensors</big></big></big></big></big></big></big></big></big></big></big></b
ig></big></big></big></font><br> </div>     <div align=Center><font
size=5 color=#551a8b> Hourly Rainfall for 0 Periods For Sensors In Map 1
Upper Cañada del Oro </font><br> </dev> <td> <FORM METHOD=POST> <TEXTAREA
NAME=Data ROWS=25 COLS=100 WRAP=OFF READONLY> </TEXTAREA> </FORM> </body>
<center> <a href=Pima.pl><b><font size=4>Main Map</font></b></a>    
  <a href=2brpssd.pl><b><font size=4>Map 2</font></b></a>    
  <a href=3brpssd.pl><b><font size=4>Map 3</font></b></a>    
  <a href=4brpssd.pl><b><font size=4>Map 4</font></b></a>    
  <a href=5brpssd.pl><b><font size=4>Map 5</font></b></a> </center>
</html>
Thanks.
M
"Nikolai Chuvakhin" <nc@iname.com> wrote in message
news:32**************************@posting.google.c om...
"Matt Daleo" <az*****@yahoo.com> wrote in message
news:<_C******************@newsread1.prod.itd.eart hlink.net>...
I'm attempting to read a remote file and parse it for data. The problem
I'm having is that the file seems to be generated by Perl
(http://alert.dot.pima.gov/scripts/1brpssd.pl) and when I read it the
script-generated data is not displayed. When I view the page with a
browser the data is displayed just fine. I've tried using the built-in PHP
commands to read the file (file, fget) as well as the all of the Snoopy "fetch"
classes (http://snoopy.sourceforge.net). Any ideas?
Try this:
$host = 'alert.dot.pima.gov';
$path = '/scripts/1brpssd.pl';
$fp = fsockopen ($host, '80');
if ($fp) {
fputs ($fp, 'GET '.$path." HTTP/1.0\r\nHost: ".$host."\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp, 10240);
}
} else {
echo "Oops... Didn't work... ";
}
Cheers,
NC