Okay, so I was going to make a webpage where you could get the lyrics to/listen to a bunch of Linkin Park songs since they are so awesome and everything. And I decided to use my 1337 php skills (or lack thereof) to make it all in one page, and I did it. But the HTML side of playing the songs doesn't seem to be working. First I tried this script, which shows the little control thing, but won't play the songs:
Of course, $song has the song name and the paths are right and such, I've verified all of that. It just won't play.PHP Code:
echo "<embed src=\"http://geofryland.kicks-ass.net/music/songs/$song.mp3\" height=\"24\" width=\"275\" autostart=\"true\" loop=\"true\">\n";
echo "<noembed>\n";
echo "<bgsound src=\"http://geofryland.kicks-ass.net/music/songs/$song.mp3\" height=\"24\" width=\"275\" autostart=\"true\" loop=\"true\">";
echo "</noembed>";
So I searched around the internet, and found another script that lets you play a song when you click the link for it. It worked just fine on the site that showed it, so I thought that I'd try it. Here's the code for it.
On the site that showed this version, when I clicked the link Windows Media Player popped up and played the song. But on my website, it just tries to open the .mp3 file in internet explorer, and gets a 404. Again I have verified paths and names, which leads me to believe that maybe I need to configure something in me Apache config file. Any ideas anyone?PHP Code:
echo "<a onclick=\"self.location=http://geofryland.kicks-ass.net/music/songs/$song.mp3'; return false\" href=\"#\">Click here to play $song</a>";
<edit>
Here's the code for the page:
</edit>PHP Code:
<html>
<head>
<title>Geo-Fry Land - Now Playing: <?php $_GET['song']; ?></title>
</head>
<body bgcolor="black" text="white">
<?
if ($_GET["version"] == "") {
?>
<form name="songs" action="index.php" method="get">
<pre>
Action: <select name="type" size="1">
<option value=Listen>Listen
<option value=Lyrics>Lyrics
<option value=Download>Download
</select>
Song Name: <select name="song" size="1">
<option value="Crawling">Crawling <!--20-->
<option value="Faint">Faint
<option value="In the End">In the End
<option value="Its Going down">Its Going Down
<option value="Numb">Numb
<option value="One Step Closer">One Step Closer
<option value="Papercut">Papercut
<option value="Points of Authority">Points of Authority
<option value="Pushing me Away">Pushing me Away
<option value="Runaway">Runaway
<option value="Somewhere I Belong">Somewhere I Belong
<option value="A Place for my Head">A Place for my Head
</select>
<input type="hidden" value="1" name="version">
<input type="submit" value="Go!">
</pre>
</form>
<?
} elseif ($_GET["version"] == "1") {
//40
$song = strtolower($_GET['song']);
$type = strtolower($_GET['type']);
if ($type == "listen") {
echo "<embed src=\"http://geofryland.kicks-ass.net/music/songs/$song.mp3\" width=\"275\" autostart=\"true\" loop=\"true\">\n";
echo "<noembed>\n";
echo "<bgsound src=\"http://geofryland.kicks-ass.net/music/songs/$song.mp3\" height=\"24\" width=\"275\" autostart=\"true\" loop=\"true\">";
echo "</noembed>";
// echo "<a onclick=\"self.location='http://geofryland.kicks-ass.net/music/songs/$song.mp3'; return false\" href=\"#\">Click here to play $song</a>";
} elseif ($type == "download") {
echo "Click <a href=\"../downloads/$song.zip\">here</a> to download $song.";
} else {
echo "Lyrics for $song coming soon.";
}
}
?>
</body>
</html>