Thanks for the response, but I'm more confused than ever. I might also add that I've never scripted with PHP so I'm pulling hairs on this one.
It appears to me that this code strips what it needs from the string passed in $playlisturl which is in a format I cannot use. The string I'm trying to strip from is passed in this format; Album - Artist - Song and can be accessed with $title[0], $title[1], and $title[2]. So, as you will see, the info returned with this html document shows only <?= $_title ?>.
Here is the code in full:
<html>
<head>
<title>Now Playing</title>
</head>
<body>
<?php
$username = "USER_NAME_HERE";
$this_url = $PHP_SELF . "?username=" . $username;
if(isset($_GET["afl"])) {
$afl = 1;
$playlisturl = "http://www.live365.com:89/pls/front?handler=playlist&cmd=view&handle=afl%3A" . $username;
} else {
$std = 1;
$playlisturl = "http://www.live365.com:89/pls/front?handler=playlist&cmd=view&handle=" . $username;
}
$fp = fopen($playlisturl, "r");
while($line = fgets($fp, 255)) {
if(ereg( "artist:\"([^\"]*)\"", $line, $regs)) {
$artist[] = $regs[1];
} else if(ereg( "title:\"([^\"]*)\"", $line, $regs)) {
$title[] = $regs[1];
} else if(ereg( "album:\"([^\"]*)\"", $line, $regs)) {
$album[] = $regs[1];
}
}
fclose($fp);
for($i=0; $i<=2; $i++) {
if($artist[$i] != "" && $artist[$i] != "ID/PSA") {
$_artist = $artist[$i];
$_title = $title[$i];
$_album = $album[$i];
break;
}
}
/* Run forever */
set_time_limit(0);
/* Load Amazon Search object */
require("AmazonSearch.php");
/* Create search object */
$AS = new AmazonSearch($Token, $Tag);
$SearchType = 'lite';
$Result = $AS->DoKeywordSearch($_artist . " " . $_album, $SearchType, 'music');
if(count($Result) == 0) {
$cover = "<img src=\"notfound.jpg\">";
} else {
$ResultRow = $Result[0];
$ImageUrlMedium = $ResultRow['ImageUrlMedium'];
$size = getimagesize($ImageUrlMedium);
if($size[0] == 1) {
$ImageUrlMedium = "notfound.jpg";
}
$cover = "<img src=\"$ImageUrlMedium\" border=0>";
}
?>
<table width="350" height="100" border="0" cellpadding="2" cellspacing="1">
<tr>
<td colspan="2" style="font-size: 12pt"> Now Playing....</td>
<td width="100" align="center" rowspan="5"><?= $cover ?></td>
</tr>
<tr>
<td width="125" align="center"<? if(isset($std)) { echo " style=\"font-weight:bold\""; } ?>><a href="<?=$this_url?>&std=1">Standard</a></td>
<td width="125" align="center"<? if(isset($afl)) { echo " style=\"font-weight:bold\""; } ?>><a href="<?=$this_url?>&afl=1">Ad-Free</a> <a href="http://www.live365.com/rewards/pm?tag=<?= $username ?>" target="_blank">[?]</a></td>
</tr>
<tr><td colspan=2> <a href="http://www.allmusic.com/cg/amg.dll?p=amg&opt1=1&uid=SEARCH&P=amg&sql=<?= urlencode($_artist) ?>"><?= $_artist ?></a></td></tr>
<tr><td colspan=2> "<?= $_title ?>"</td></tr>
<tr><td colspan=2> <i><?= $_album ?></i></td></tr>
</table>
</body>
</html>
If you wish to get a visual of this code in action you can plug in tunester67 as a username showing the code working and the username satellitestar which will show my dilemma.
Thanks for your patience.