switch($list) {
case "dvd":
$heading = "Recently Purchased DVDs";
$file = "dvd_list";
break;
case "mysteries":
$heading = "Recently Purchased Mystery Books";
$file = "mystery_list";
break;
case "anf":
$heading = "Recently Purchased Adult Fiction";
$file = "anf_list";
break;
case "anfn":
$heading = "Recently Purchased Adult Non-Fiction";
$file = "anfn_list";
break;
case "ya":
$heading="Recently Purchased Young Adult Fiction";
$file="ya_list";
break;
case "oo":
$heading="Titles On Order";
$file="onorder_list";
break;
case "eb":
$heading="E-Books";
$file="ebooks_list";
break;
}
echo "
$heading
\n";
$f = fopen($file,"r");
while($array = fgetcsv($f,5000,"\t")) {
list ($title,$author,$bib) = $array;
echo"
$title";
if (!empty($author)) echo" by $author";
echo"
\n";
}
fclose($f);
?>