5) break; } return $songs; } //the function that displays the track info function dispTracks(){ $tracks = gettracks(); if ($tracks !=""){ foreach ($tracks as $song) { $playdate = date("F j, Y, g:i a", $song[playtime]); print "".truncate($song[title],30)." - ".truncate($song[artist],20)."
"; } } else echo "Empty Tracks.txt file"; } //fixed the bug with register globals being off $add = $_GET["add"]; $track = $_GET["t"]; $artist = $_GET["a"]; $genre = $_GET["g"]; $album = $_GET["al"]; //checking if we should be adding or not if ($add ==1){ addHistory($track,$artist,$genre,$album); }else dispTracks(); ?>