<?
include ("tunez.inc.php");
include ("tunez_admin.inc.php");
$filename = "/
$filehandle = fopen("$filename","r");
$size = filesize("$filename");
$seek = fseek($filehandle, $size-128);
$tag = fgets($filehandle,128);
if (strstr("$tag", "TAG") || strstr("$tag", "tag"))
{
# Extract the tag data and close the file
# This is the correct order...
$songtitle = trim(substr($tag,3, 30));
$artist = trim(substr($tag,33, 30));
$album = trim(substr($tag,63, 30));
$year = substr($tag,93, 4);
$comment = trim(substr($tag,97,30));
# Grab last char for the Genre
# This can get confused for EOF with fgets
$seek = fseek($filehandle, $size-1);
$gen = ord(fgetc($filehandle));
$genre = $genrename[$gen];
echo "<b>Artist:</b> $artist <br>";
echo "<b>Songtitle:</b> $songtitle <br>";
echo "<b>Album:</b> $album <br>";
echo "<b>Jaar:</b> $year <br>";
echo "<b>Genre:</b> $genre <br>";
?>