good tag reader gone bad
Posted: Sat Jan 06, 2007 1:37 pm
hi all-- i have been using this script (thanks to all of the help from these forums) to read b/w <b> tags in specific html files:
All was working fine, until recently. While tighting up the site directories, i placed all the site's existing directories into one called 2007. In the past i could retreive the script output as so:
the new mapping is:
however, rather than a clean xml with only the text from the bold entries, the script is now reading tons of other tags after the first <b> tag
...what happend?
Code: Select all
<xml>
<?php
$menuType=$_GET['selDir'];
$selYear=$_GET['selYear'];
$fileName="../images/$selYear/".$menuType."/".$menuType.".html";
$handle=fopen($fileName,"r");
$contents=fread($handle,filesize($fileName));
$wanted=preg_match_all('/<b>(.*)<\/b>/', $contents, $matches,PREG_SET_ORDER);
fclose($handle);
$i=0;
foreach($matches as $value){
echo ("$value[0]");
}
?>
</xml>Code: Select all
http://www.website.com/php/xml.php?selDir=VENICE&selYear=2005Code: Select all
http://www.website.com/2007/php/xml.php?selDir=VENICE&selYear=2005Code: Select all
<xml>
<b>Venetian Weekend</b>
</td>
<td align="center" width="33%">
<a href="Venice-Pages/Image1.html"><img height="160" alt="Venetian Weekend" width="240" src="Venice-Thumbnails/1.jpg"></a>
<br><b>Venetian Weekend</b>
</td>
<td align="center" width="33%">
<a href="Venice-Pages/Image2.html"><img height="160" alt="Venetian Weekend" width="240" src="Venice-Thumbnails/2.jpg"></a>
<br><b>Venetian Weekend</b>
</td>
</tr>
....etc