Advertisement
Guest User

Untitled

a guest
Apr 8th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en-gb">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Artists Search</title>
  6. <meta name="iSongs online music shop by Atish Khadka" content="Search for an Artist to see more information about them.">
  7.  
  8. <link rel="stylesheet" href="isongs.css">
  9. </head>
  10. <body>
  11. <div class="container">
  12. <div class="header">
  13. <h1>iSongs</h1>
  14. </div>
  15. <div class="nav">
  16. <ul>
  17. <li><a href="index.php">Home</a></li>
  18. <li><a href="songs_artists.php">Songs and artists</a></li>
  19. <li><a href="songs_artists_dropdown.php">Artist</a></li>
  20. <li><a href="reg_form.php ">Register</a></li>
  21. <li><a href="view_customers.php">Customers</a></li>
  22. <li><a href="search_customer.php">Transactions</a></li>
  23. <li><a href="#">User guide</a></li>
  24. </ul>
  25. </div>
  26.  
  27. <div class="content">
  28.  
  29. <form action="process_dropdown.php" method="post">
  30. <select name='artist'>
  31.  
  32.  
  33. <?php
  34.  
  35. $servername = "80.82.112.181";
  36. $username = "15095173u2";
  37. $password = "15095173p2";
  38. $dbname = "15095173_music_db";
  39.  
  40. $conn = new mysqli($servername, $username, $password, $dbname);
  41. if ($conn->connect_error) {
  42. die("Connection failed: " . $conn->connect_error);
  43. }
  44.  
  45. $sql = "SELECT Artist_ID, Artist_name FROM artist";
  46.  
  47. $result = $conn->query($sql);
  48.  
  49.  
  50. echo "debug 1";
  51. ?>
  52.  
  53. <?php /* Select queries return a resultset */
  54. if ($result = $mysqli->query("SELECT Artist_ID, Artist_name FROM artist")) {
  55.  
  56.  
  57. while ($row = $result->fetch_array()) {
  58. echo '<option>' . $row['Artist_name'] .'</option>';
  59. }
  60.  
  61.  
  62. /* free result set */
  63. $result->close();
  64. }
  65.  
  66.  
  67.  
  68. <option value>--Please select an artist--</option>
  69. <input type="submit" name="submit" value="Search artists songs">
  70.  
  71. </select>
  72. </form>
  73.  
  74. ?>
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81. </div>
  82. <div class="footer">
  83. <p>&copy; <a href="http://www.mmu.ac.uk/" title="MMU homepage">MMU 2016</a> | STUDENT COURSEWORK | TUTOR <a href="mailto:c.dawson@mmu.ac.uk">Chris Dawson</a> | <a href="http://validator.w3.org/check?uri=referer" title="W3C HTML Validation Service" >Valid HTML</a> </p>
  84. </div>
  85. </div>
  86. </body>
  87. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement