<?php
$pattern = 'php';
$home = '/home/tom/';
$dir = substr(getcwd(), strlen($home));

foreach (scandir('.') as $file)
{
    if ($file != '.' and $file != '..')
    {
        if ($file != 'listing.php') {
            echo "<a href='http://www.ridersdiscount.com/$dir/$file'>$file</a><br />";
        }
    }
}
?>
