Page 1 of 1

Scrape table from CPanel FTP accounts page

Posted: Sun Jul 03, 2005 11:43 am
by linuxinit
Here is the content that I want to extract:

Code: Select all

<b>Ftp Disk Usage/Quotas</b><br>
<table align=center><tr><td>
<table><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr></table>
</td></tr></table>
First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\/Quotas<\/b><br>";
  $end = "used<\/td><\/tr><\/table>";
  
  preg_match("/^$start(.*)$end$/",$cont,$match);
  
  echo "$match[1]</td></tr></table>";
?>
I have tinkered with this all I can stand. Has anyone tried to do what I'm doing or know how to fix it? It seems to be a problem with multiple lines and backwards slashes in the source...mp;amp;lt;tr><td>
<table><tr>&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder>&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forwar<tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr></table>
</td></tr></table>


First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Thmp;lt;b>Ftp Disk Usage/Quotas</b><br>
<table align=center><tr><td>
<table><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr></table>
</td></tr></table>


First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\/Quotas<\/b><br>";
  $end = "used<\/td><\/tr><\/table>";
  
  preg_match("/^$start(.*)$end$/",$cont,$match);
  
  echo "$match[1]</td></tr></table>";
?>
I have tinkered with this all I can stand. Has anyone tried to do what I'm doing or know how to fix it? It seems to be a problem with multiple lines and backwards slashes in the source...th=#></td><td>0.00/50.00M</td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty arramp;amp;lt;br>
<table align=center><tr&gt;&lt;td&gt;
&lt;table&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\/Quotas<\/b><br>";
  $end = "used<\/td><\/tr><\/table>";
  
  preg_match("/^$start(.*)$end$/",$cont,$match);
  
  echo "$match[1]</td></tr></table>";
?>
I have tinkered with thi3]<b>Ftp Disk Usage/Quotas</b>&lt;br&gt;
&lt;table align=center&gt;&lt;tr><td>
<table><tr><td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\/Quotas&lt;\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\/td&gt;&ampt that I want to extract:

Code: Select all

<b>Ftp Disk Usage/Quotas</b><br>
<table align=center><tr><td>
<table><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr></table>
</td></tr></table>
First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\/Quotas<\/b><br>";
  $end = "used<\/td><\/tr><\/table>";
  
  preg_match("/^$start(.*)$end$/",$cont,$match);
  
  echo "$match[1]</td></tr></table>";
?>
I have tinkered with this all I can stand. Has anyone tried to do what I'm doing or know how to fix it? It seems to be a problem with multiple lines and backwards slashes in the source...p;amp;lt;b>Ftp Disk Usage/Quotas&lt;/b&gt;&lt;br&gt;
&lt;table align=center&gt;&lt;tr&gt;<td>
&lt;table&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\/Quotas&lt;\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;&quote;;
  
  preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  
  echo &quote;$match&#1111;1]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quote;;
?&ct:

Code: Select all

<b>Ftp Disk Usage/Quotas</b><br>
<table align=center><tr><td>
&lt;table&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td>0% used</td></tr></table>
</td></tr></table>
[/code:1t that I want to extract:

[code]<b>Ftp Disk Usage/Quotas</b><br>
<table align=center><tr><td>
&lt;table&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
[/code]

First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

[php]
&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\/Quotas&lt;\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;&quote;;
  
  preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  
  echo &quote;$match&#1111;1]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quote;;
?&gt;
[/php]

I have tinkered with this all I can stand. Has anyone tried to do what I'm doing or know how to fix it? It seems to be a problem with multiple lines and backwards slashes in the t;
<table><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#>&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\/Quotas&lt;\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;&quote;;

Code: Select all

<b>Ftp Disk Usage/Quotas</b><br>
<table align=center><tr><td&gt;
&lt;table&gt;&lt;tr&gt;&lt;td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\/Quotas&lt;\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\/p Disk Usage/Quotas</b><br>
<table align=center><tr&gt;&lt;td&gt;
&lt;table&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\/Quotas<\/b><br>";
  $end = "used<\/td><\/tr><\/table>";
  
  preg_match("/^$start(.*)$end$/",$cont,$match);
  
  echo "$match[1]</td></tr></table>";
?>
I have tinkered with this all I can stand. Has anyone tried to do what I'm doing or know how to fix it? It seems to be a r>
<table align=center><tr><td>
<table><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td>&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\/Quotas&lt;\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\/td&gt;&lt;\/tr&;b>Ftp Disk Usage/Quotas</b><br>
<table align=center>&lt;tr&gt;&lt;td&gt;
&lt;table&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\/Quotas&lt;\/b&gt;&lt;br&gtt that I want to extract:

Code: Select all

<b>Ftp Disk Usage/Quotas</b><br>
<table align=center>&lt;tr&gt;&lt;td&gt;
&lt;table&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\/Quotas<\/b><br>";
  $end = "used<\/td><\/tr><\/table>";
  
  preg_match("/^$start(.*)$end$/",$cont,$match);
  
  echo "$match[1]</td></tr></table>";
?>
I have tinkered with this all I can stand. Has anyone tried to do what I'sk Usage/Quotas</b>&lt;br&gt;
&lt;table align=center&gt;&lt;tr&gt;&lt;td>
&lt;table&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\/Quotas&lt;\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;&quote;;
  
  preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  
  echo &quote;$match&#1111;1]&lt;/td&gt;&lt;/tr&gt;&lt;/tablet that I want to extract:

Code: Select all

<b>Ftp Disk Usage/Quotas&lt;/b&gt;<br>
<table align=center><tr><td>
<table><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\/Quotas&lt;\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;&quote;;
  
  preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  
  echo &quote;$match&#1111;1]</b><br>
&lt;table align=center&gt;&lt;tr&gt;&lt;td>
<table>&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;<img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
First, I had problems with single quotes and double quotes, so I had the script go in and backslash all o<b>Ftp Disk Usage/Quotas</b><br>
<table align=center><tr><td>
<table><tr><td>username</td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;<td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td>amp;lt;table align=center><tr><td>
<table><tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\/Quotas<\/b><br>";
  $end = "used<\/td><\/tr><\/table>";
  
  preg_match("/^$start(.*)$end$/",$cont,$match);
  
  echo "$match[1]</td></tr></table>";
?>
I have tinkered with this all I can amp;gt;
<table align=center><tr><td>
<table><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


First, I had problems with single quotes and double quotes, so I had the script go in and backslash all of the double quotes and output the results to a new variable. Then I had problems with backslashes ending the table elements, so I had the script add forward slashes to all of them. Then I started getting no output whatsoever. Just an empty array. I messed with it more and now it is completely screwed up.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\/Quotas&lt;\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&amptp Disk Usage/Quotas</b><br>
<table align=center><tr><td>
<table><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder><img src=bar.gif height=8 width=#><img src=wbar.gif height=8 width=#></td><td>0.00/50.00M</td><td>0% used</td></tr><tr><td>username</td><td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td class=barborder&gt;&lt;img src=bar.gif height=8 width=#&gt;&lt;img src=wbar.gif height=8 width=#&gt;&lt;/td&gt;&lt;td&gt;0.00/50.00M&lt;/td&gt;&lt;td&gt;0% used&amp

Posted: Sun Jul 03, 2005 12:55 pm
by Chris Corbyn
Moved to regex

Posted: Sun Jul 03, 2005 1:03 pm
by Chris Corbyn
There's one or two things to change. Define the pattern outside of the preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! :P). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo "$match[1]</td></tr></table>";
?>
even gets to look for it (Hmm.... yummy! :P). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo "$match[1]</td></tr></table>";
?>
port/dir/dir/blah/accounts.html');
$start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
$end = "used<\\/td><\\/tr><\\/table>";
$pattern = '/'.$start.'(.*?)'.$end.'/s';
//preg_match("/^$start(.*)$end$/",$cont,$match);
preg_match($pattern,$cont,$match);
echo "$match[1]</td></tr></table>";
?>
reg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! :P). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo "$match[1]</td></tr></table>";
?>
;<\\/tr><\\/table>";
$pattern = '
".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! :P). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  preg_match($pattern,$cont,$match);
  of the preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt; things to change. Define the pattern outside of the preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo "$match[1]</td></tr></table>";
?>
e preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! :P). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$end$/&quoine the pattern outside of the preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  preg_match($pattern,$cont,$match);
  echo &quote;$match&#1111;1]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quote;;
?&gt;
things to change. Define the pattern outside of the preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! :P). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo "$match[1]</td></tr></table>";
?>
[/php:1:77e ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &a the pattern outside of the preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/s far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  preg_match($pattern,$cont,$match);
  echo &quote;$match&#1111;1]&lt;/td&gt;&lt;/tr&gt;&lt;eedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&atch() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start =  things to change. Define the pattern outside of the preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  preg_match($pattern,$cont,$match);
  echo &quote;$match&#1111;1]&lt;/td&amr easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quot things to change. Define the pattern outside of the preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;te things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo "$match[ the preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  preg_match($pattern,$cont,$match);
  echo &quote;$match&#1111;1]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quote;;
?&gt;
It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! :P). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  preg_match($pattern,$cont,$match);
  echo &qudy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&'s far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo "$match[1]</td></tr things to change. Define the pattern outside of the preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&goutside of the preg_match() since it's far easier to concatenate things together.

".*" is greedy --> It gobbles up $end before the regex engine even gets to look for it (Hmm.... yummy! ). Use ".*?" to make it lazier.

Add the "s" modifier so it searches over multiple lines since by default regex only check one line (that includes the dot "." metacharacter).

Lose the caret and dollar (start and end of string markers) since this pattern occurs somewhere in the middle of your document so they will break it.

You need more backslashes too.

Code: Select all

<?php
  $cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo "$match[1]</td></tr></table>";
?>

Posted: Sun Jul 03, 2005 5:16 pm
by linuxinit
Here is the working script if anyone wants it. :-) Thanks a million!!!

Code: Select all

<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas</b>

<?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo("$match[1]");
?>

</td></tr></table
Save bar.gif and wbar.gif to the directory that the script is in.

Thanks again!!! :-)er {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

&lt;/style&gt;

&lt;b&gt;Ftp Disk Usage/Quotas&lt;/b&gt;

&lt;?php
$cont = file_get_contents('http://user:pass@domain:2082/frontend/x ... ounts.html');
$start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
$end = "used<\\/td><\\/tr><\\/table>";
$pattern = '/'.$start.'(.*?)'.$end.'/s';
//preg_match("/^$start(.*)$end$/",$cont,$match);
preg_match($pattern,$cont,$match);
echo("$match[1]");
?>

</td></tr></table


Save bar.gif and wbar.gif to the directory that the script is in.

Thanks again!!! :-)mp;lt;b>Ftp Disk Usage\\/Quotas<\\/b><br>";
$end = "used<\\/td><\\/tr><\\/table>";
$pattern = '/'.$start.'(.*?)'.$end.'/s';
//preg_match("/^$start(.*)$end$/",$cont,$match);
preg_match($pattern,$cont,$match);
echo("$match[1]");
?>

</td></tr></table


Save bar.gif and wbar.gif to the directory that the script is in.

Thanks again!!! :-)

Code: Select all

<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas</b>

<?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo("$match[1]");
?>

</td></tr></table
Save bar.gif and wbar.gif to the directory that the script is in.

Thanks again!!! :-)mp;quote;;
$pattern = '/'.$start.'(.*?)'.$end.'/s';
//preg_match("/^$startly: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

&lt;/style&gt;

&lt;b&gt;Ftp Disk Usage/Quotas&lt;/b&gt;

&lt;?php
$cont = file_get_contents('http://user:pass@domain:2082/frontend/x ... ounts.html');
$start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
$end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
$pattern = '/'.$start.'(.*?)'.$end.'/s';
//preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
preg_match($pattern,$cont,$match);
echo(&quote;$matchї1]&quote;);
?&gt;

&lt;/td&amion!!!

Code: Select all

<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas&lt;/b&gt;

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&g script if anyone wants it. :-) Thanks a million!!!

Code: Select all

<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas</b>

<?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo("$match[1]");
?&gt;

&lt;/td&gt;&lt;/tr&gt;&lt;/table
Save bar.gif and wbar.gif to the directory that the script is in.

Thanks again!!! :-)!

Code: Select all

<style&gt;
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

&lt;/style&gt;

&lt;b&gt;Ftp Disk Usage/Quotas&lt;/b&gt;

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  preg_match($pattern,$cont,$match);
  echo(&quote;$match&#1ts it. :-) Thanks a million!!!

Code: Select all

<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

&lt;/style&gt;

&lt;b&gt;Ftp Disk Usage/Quotas&lt;/b&gt;

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  preg_match($pattern,$cont,$match);
  echo(&quote;$match&#1111;1]&quote;);
?&gt;

&lt;/td&gt;&lt;/tr&gt;&lt;/table
Save bar.gif and wbar.gif to the directory that the script is in.

Thanks again!!! :-)g script if anyone wants it. :-) Thanks a million!!!

Code: Select all

<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas</b>

<?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo("$match[1]");
?>

</td></tr></table
Save bar.gif and wbar.gif to the directory that the script is in.

Thanks agaily:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style&gt;

&lt;b&gt;Ftp Disk Usage/Quotas&lt;/b&gt;

&lt;?php
$cont = file_get_contents('http://user:pass@domain:2082/frontend/x ... ounts.html');
$start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
$end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\it. :-) Thanks a million!!!

Code: Select all

<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas</b>

<?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = &a
<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas</b>

<?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo("$match[1]");
?>

</td></tr></table
Save bar.gif and wbar., arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas</b&gt;

&lt;?php
$cont = file_get_contents('http://user:pass@domain:2082/frontend/x ... ounts.html');
$start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
$end = &quote;used&lt;\\/td&p]
<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas</b>

<?php
$cont = file_get_contents('http://user:pass@domain:2082/frontend/x ... ounts.html');
$start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gg script if anyone wants it. :-) Thanks a million!!!

Code: Select all

<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

&lt;/style&gt;

&lt;b&gt;Ftp Disk Usage/Quotas&lt;/b&gt;

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  preg_match($pattern,$cont,$match);
  echo(&quote;$match&#1111;1]&quote;);
?&gt;

&lt;/td&gt;&lt;/tr&gt;&lt;/tablp;amp;lt;style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

&lt;/style&gt;

&lt;b&gt;Ftp Disk Usage/Quotas&lt;/b&gt;

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
  preg_match($pattern,$cont,$match);
g script if anyone wants it. :-) Thanks a million!!!

Code: Select all

<style&gt;
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

&lt;/style&gt;

&lt;b&gt;Ftp Disk Usage/Quotas&lt;/b&gt;

&lt;?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
  $end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match(&quote;/^$start(.*)$p;gt;
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas</b>

<?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo("$match[1]");
?>

</td>&amn!!!

Code: Select all

<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas</b>

<?php
  $cont = file_get_contents('http://user:pass@domain:2082/frontend/x/ftp/accounts.html');
  $start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
  $end = "used<\\/td><\\/tr><\\/table>";
  $pattern = '/'.$start.'(.*?)'.$end.'/s';
  //preg_match("/^$start(.*)$end$/",$cont,$match);
  preg_match($pattern,$cont,$match);
  echo("$match[1]");
?>

</td></tr></table
Save bar.gif and wbar.gif to the directory that the script is in.

Thanks again!!! :-)ca, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

&lt;/style&gt;

&lt;b&gt;Ftp Disk Usage/Quotas&lt;/b&gt;

&lt;?php
$cont = file_get_contents('http://user:pass@domain:2082/frontend/x ... ounts.html');
$start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
$end = &quote;used&lt;\\/td&gt;&lt;\\/tr&gt;&lt;\\/table&gt;&quote;;
$pattern = '/'.$start.'(.*?)'.$end.'/s';
//preg_match(&quote;/^$start(.*)$end$/&quote;,$cont,$match);
preg_match($pattern,$cont,$match);
echo(&quote;$matchї1]&quote;);
?&gt;

&lt;/td&gt;&amarial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas&lt;/b&gt;

&lt;?php
$cont = file_get_contents('http://user:pass@domain:2082/frontend/x ... ounts.html');
$start = &quote;&lt;b&gt;Ftp Disk Usage\\/Quotas&lt;\\/b&gt;&lt;br&gt;&quote;;
$end = &quote;used&lt;\\/td&gt;&lt;\\/tr&a
<style>
body {font-family: verdana, arial, helvetica, sans-serif; font-size: 10px;}
.barborder {border: 1px solid #000000;}
table {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
tr {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}
td {font-family:verdana, arial, helvetica, sans-serif; font-size:10px}

</style>

<b>Ftp Disk Usage/Quotas</b>

<?php
$cont = file_get_contents('http://user:pass@domain:2082/frontend/x ... ounts.html');
$start = "<b>Ftp Disk Usage\\/Quotas<\\/b><br>";
$end = "used<\\/td><\\/tr><\\/table>";
$pattern = '/'.$start.'(.*?)'.$end.'/s';
//preg_match("/^$start(.*)$end$/",$cont,$match);
preg_match($pattern,$cont,$match);
echo("$match[1]");
?>

</td></tr></table


Save bar.gif and wbar.gif to the directory that the script is in.

Thanks again!!! :-)