Jump to content

Recommended Posts

Hi guys i am working on creating a Music playlist program. I have a multidimensional array for 18 songs and 6 artists.

The way i have it set up now, Each Artist has 3 radio buttons for there respective songs. My issue is that i have the radio buttons being printed from a for/each loop and it just looks like a list of the songs on the page. I was wondering how i could maybe insert them into a table or a box to kinda flavor it up. Looks plain to me for the artists and songs to just be sittin on the page.

Any Help would be greatly appreciated!!!!

Thanks!

 

 

Link to comment
https://forums.phpfreaks.com/topic/261615-radio-buttons-and-tables/
Share on other sites

Here is the code Sorry!

 

<?php
$playlist=array(
'Kanye West'=>array('Who Will Survive In America','Lost In the World','All of the Lights'),
'Al Green'=>array('Im Still in Love With You','Love and Happiness','Look What You Done for Me'),
'Babyface'=>array('Everytime I Close My Eyes','Where Will You Go','When Can I See You'),
'De La Soul'=>array('Me Myself and I','Breakadawn','Ring Ring Ring'),
'Isley Brothers'=>array('Make Me Say It Again','Footsteps In The Dark','Groove With You'),
'Talib Kweli'=>array('Shock Body','Good to You','Wont You Stay'),
);
?>

<html>


<style type="text/css">
#music {position: absolute; top:80;center:320px}
#song {position: absolute; left:180px}
</style>
<body style="background-image:url('images/Turntable.jpg ');">
<form action="Program6-Music.php" method="post">
<div id="song">
<?php
if(isset($_POST['song']))
{

$song=$_POST['song'];
print "<marquee><font color='gold' size='7'>Welcome to Jam-On-It. You're enjoying the sounds of <font color='green'><i>*$song*</i></font>!</font></marquee><br>";
  echo "<font color='red' size='4'><embed src ='songs/$song.wma' hidden='true' autostart='true'></embed></font>";
unset($_POST['song']);
}
?>
</div>
<div id="music" >
<?php
foreach($playlist as $artist=>$track)
{
  print"<font color='gold' size='4'><b>$artist</b></font><br>";
   for($i=0;$i<count($track);$i++)
   {
    print"<font color='blue' size='4'><input type='radio' name='song' value='$track[$i]'><b>$track[$i]</b></font><br>";
   }
}
?>
<input type="submit" value="play/pause">
</div>
</form>
</body>
</html>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.