Jump to content

irish_stevo

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About irish_stevo

  • Rank
    Newbie
  1. Got it working it seems. Forgot to close off the PHP with : echo $album_info;
  2. Thanks dsonesuk. But no luck im afraid. All that down was move the position of the Submit button on the form. Still shows up a blank php page.
  3. When i select an option from the drop-down and hit Submit, it just brings me to a blank page, with the URL: http://localhost/project/chosen_album.php
  4. Hi guys, i have a bit of a PHP problem and would appreciate a bit of help. I am currently doing a project in college and it involves PHP, which i am a bit dodgy on. Basically we have to create a HTML page, with a drop box menu showing 5 music albums, and a Submit button. Here is what i have to show up the Deopdown menu in HTML: [/color]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">[/color]<html> <head><title>Album List</title></head> <form action="chosen_album.php" method="post"> <select name="albums"><option value="1">Appetite For Destruction</option><option value="2">Out Of Exile</option><option value="3">West Ryder Pauper Lunatic Asylum</option><option value="4">One By One</option><option value="5">Master Of Puppets</option> <p><input type="submit" name="submit" value="Submi" </p></select></form> </body></html> Now, when you pick an album name and hit submit, it should bring you to a page showing all the album info, track list, etc. (I have all this info from a previous project). But where im stuck is for the PHP code needed to link the HTML drop box page. This is my PHP code so far, but doesnt seem to work properly. I am using a Wamp server for my loclahost which is up and running ok, so dont think thats the problem: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head><title>Chosen Album</title></head> <?php$chosen_album = $_POST['albums'];$album_info = ''; if ($chosen_album== 1) {//appetite for destruction$album_info ='<p class="album_title">Appetite For Destruction</p><p class="artist">Artist: Guns N Roses</p><p class="track_list">Track List:</p><ol class="list"><li>Welcome to the jungle</li><li>Its so easy</li><li>Nightrain</li><li>Out ta get me</li><li>Mr Brownstone</li><li>Paradise city</li><li>My Michelle</li><li>Think about you</li><li>Sweet Child o mine</li><li>Youre crazy</li><li>Anything goes</li><li>Rocket queen</li> </ol> <iframe width="420" height="315" src="http://www.youtube.com/embed/i_gQOfF0Ymo" frameborder="0" ';}if($chosen_album==2) {//out of exile$album_info = '<p class="album_title">Out Of Exile</p><p class="artist">Artist: Audioslave</p><p class="track_list">Track List:</p><ol class="list"><li>Your Time Has Come</li><li>Out Of Exile</li><li>Be Yourself</li><li>Doesnt Remind Me</li><li>Drown Me Slowly</li><li>Heavens Dead</li><li>The Worm</li><li>Man Or Animal</li><li>Yesterday To Tomorrow</li><li>Dandelion</li><li>#1 Zero</li><li>The Curse</li><li>Like A Stone</li></ol><iframe width="420" height="315" src="http://www.youtube.com/embed/f_4MBuxMBN4" frameborder="0" allowfullscreen></iframe>';}if($chosen_album== 3) {//west ryder.......$album_info = '<p class="album_title">West Ryder Pauper Lunatic Asylum</p><p class="artist">Artist: Kasabian</p><p class="track_list">Track List:</p><ol class="list"><li>Underdog</li><li>Where Did All The Love Go?</li><li>Swarfiga</li><li>Fast Fuse</li><li>Take Aim</li><li>Thick As Thieves</li><li>West Ryder Silver Bullet</li><li>Vlad The Impaler</li><li>Ladies & Gentlemen (Roll The Dice)</li><li>Secret Alphabets</li><li>Fire</li><li>Happiness</li></ol><iframe width="560" height="315" src="http://www.youtube.com/embed/tjMnhiCUnr0" frameborder="0" allowfullscreen></iframe>';}?> (NOTE: I have only filled info for the first 3 items on the drop box to test it out)Basically, at the end i should have 1 HTML file (dropbox), 1 PHP file (album info) and 1 CSS file for styles (which im ok with.) Any help would be appreciated.
×
×
  • Create New...