Scrape table from CPanel FTP accounts page
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>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>";
?><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 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>";
?></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 arramp;amp;lt;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>";
?><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 = "e;<b>Ftp Disk Usage\/Quotas<\/b><br>"e;;
$end = "e;used<\/td>&t 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>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>";
?><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 = "e;<b>Ftp Disk Usage\/Quotas<\/b><br>"e;;
$end = "e;used<\/td><\/tr><\/table>"e;;
preg_match("e;/^$start(.*)$end$/"e;,$cont,$match);
echo "e;$matchї1]</td></tr></table>"e;;
?&ct: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>
[/code:1t that I want to extract:
[code]<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>
[/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]
<?php
$cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
$start = "e;<b>Ftp Disk Usage\/Quotas<\/b><br>"e;;
$end = "e;used<\/td><\/tr><\/table>"e;;
preg_match("e;/^$start(.*)$end$/"e;,$cont,$match);
echo "e;$matchї1]</td></tr></table>"e;;
?>
[/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=#><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>Code: Select all
<?php
$cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
$start = "e;<b>Ftp Disk Usage\/Quotas<\/b><br>"e;;
$end = "e;used<\/td><\/tr><\/table>"e;;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>Code: Select all
<?php
$cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
$start = "e;<b>Ftp Disk Usage\/Quotas<\/b><br>"e;;
$end = "e;used<\/p 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>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>";
?><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 = "e;<b>Ftp Disk Usage\/Quotas<\/b><br>"e;;
$end = "e;used<\/td><\/tr&;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>Code: Select all
<?php
$cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
$start = "e;<b>Ftp Disk Usage\/Quotas<\/b><br>t 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>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>";
?><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 = "e;<b>Ftp Disk Usage\/Quotas<\/b><br>"e;;
$end = "e;used<\/td><\/tr><\/table>"e;;
preg_match("e;/^$start(.*)$end$/"e;,$cont,$match);
echo "e;$matchї1]</td></tr></tablet 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>Code: Select all
<?php
$cont = file_get_contents('http://user:pass@domain:port/dir/dir/blah/accounts.html');
$start = "e;<b>Ftp Disk Usage\/Quotas<\/b><br>"e;;
$end = "e;used<\/td><\/tr><\/table>"e;;
preg_match("e;/^$start(.*)$end$/"e;,$cont,$match);
echo "e;$matchї1]</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><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>amp;lt;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>";
?><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 = "e;<b>Ftp Disk Usage\/Quotas<\/b><br>"e;;
$end = "e;used<\/td><\/tr><\/table&tp 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&