Code: Select all
<?php
class Dirview
{
public function dirlist($name) {
global $data
$TrackDir=opendir($name."/");
function filename_safe($file) {
$temp = $file;
$temp = str_replace("-", " ", $temp);
$result = '';
for($i=0; $i<strlen($temp); $i++) {
if(preg_match('([0-9]|[a-z]|_)', $temp[$i])) {
$result = $result . $temp[$i];
}
}
}
while($file = readdir($TrackDir)) {
$ext = substr($file, strrpos($file, '.') + 1);
if($file == "." || $file == ".." || $ext == "db"){}
else {
$temp = $file;
print "<a rel='$name' href='$dir/$temp'></a>";
}
}
closedir($TrackDir);
return $data;
}
}
?>Code: Select all
<?php
include("dirview-class.php);
$dir = new Dirview;
$dir->dirlist('Australia');
?>
line 90 according to alleycode isParse error: syntax error, unexpected T_STRING in C:\WEB_ROOT\galleryclass.php on line 90
<!-- <a rel="australia" href="Australia/img6.jpg"> </a>
not sure how that works because I am ending my php as you can see from above. Any help on this one please