Advertisement
Guest User

Untitled

a guest
Apr 14th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Page Title</title>
  5.  
  6. <style>
  7.  
  8.  
  9. ul {
  10. list-style-type: none; /*Removes the bullet points*/
  11. margin: 0;
  12. padding: 0;
  13. overflow: hidden; /*Pushes the text to the next line*/
  14. background-color: gray;
  15. }
  16.  
  17. li {
  18. float: left; /*Gets the list horizontal*/
  19. }
  20.  
  21. li a {
  22. display: block;
  23. color: Black;
  24. text-align: center;
  25. padding: 14px 16px;
  26. text-decoration: none;
  27. }
  28.  
  29.  
  30. li a:hover {
  31. background-color: firebrick;
  32. }
  33.  
  34.  
  35. </style>
  36. </head>
  37. <body>
  38.  
  39. <h1>Home</h1>
  40.  
  41. <ul>
  42. <li><a href="http://localhost/DBI_CW_Home.php"> Home </a></li>
  43. <li><a href="http://localhost/DBI_CW_Artist.php"> Artist </a></li>
  44. <li><a href="http://localhost/DBI_CW_Albums.php"> Albums </a></li>
  45. <li><a href="http://localhost/DBI_CW_Tracks.php"> Tracks </a></li>
  46. </ul>
  47.  
  48. <p>GB5DBI Example Assingment for Psymc3</p>
  49.  
  50. <h1>Database demo #1: create database connection</h1>
  51.  
  52. <?php
  53.  
  54. $servername = "localhost";
  55. $username = "psymc3@localhost";
  56. $password = "BKGYEE";
  57. $dbname = "psymc3";
  58. $conn = mysqli_connect($servername, $username, $password, $dbname);
  59.  
  60. // Create a database connection
  61. $conn = mysqli_connect($servername, $username, $password, $dbname);
  62.  
  63. // Check connection
  64. if(mysqli_connect_errno())
  65. {
  66. echo "Failed to connect to MySQL: ".mysqli_connect_error();
  67. die();
  68. }
  69. else echo "MySQL connection OK<br>"; // useful for testing
  70.  
  71. // Close database connection
  72. mysqli_close($conn);
  73.  
  74. ?>
  75. </body>
  76.  
  77.  
  78. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement