jetlife76 Posted April 26, 2012 Share Posted April 26, 2012 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! Quote Link to comment https://forums.phpfreaks.com/topic/261615-radio-buttons-and-tables/ Share on other sites More sharing options...
jetlife76 Posted April 26, 2012 Author Share Posted April 26, 2012 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> Quote Link to comment https://forums.phpfreaks.com/topic/261615-radio-buttons-and-tables/#findComment-1340575 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.