Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. <?php
  2. /**
  3. * User: Kevin
  4. * Date: 20/2/2018
  5. * Time: 1:44 PM
  6. * Bestand: .php
  7. */
  8. include ("functions.php");
  9.  
  10. $query = " SELECT * From Optreden WHERE username = ". $_GET[' username'] .";";
  11.  
  12. // Starten van een database connectie
  13. startConnection();
  14.  
  15. // Executeren van een SQL query
  16. $query = "SELECT * FROM mojo";
  17. if (isset($_GET["zoekwoord"]) == true)
  18. {
  19. $woord = $_GET["zoekwoord"];
  20. $query = "SELECT * FROM Organizators WHERE userName LIKE '%$woord%'";
  21. }
  22. else
  23. {
  24. $query = "SELECT * FROM Organizators";
  25. }
  26. $jokes = executeQuery($query);
  27.  
  28. ?>
  29.  
  30. <!DOCTYPE html>
  31.  
  32. <html>
  33. <head>
  34. <title>
  35. <?php echo "Template" ?>
  36. </title>
  37. <meta name="description" content="Template">
  38. <meta name="keywords" content="Teamplate">
  39. <meta charset="utf-8">
  40. <link rel="stylesheet" type="text/css" href="../../../css/style.css">
  41. </head>
  42. <body>
  43. <form action="Opdracht%207.3.php" method="get" id="wrapper">
  44. <?php
  45. include ("../../../Hoofdstuk 4/Opdracht 4.1/header.php");
  46. ?>
  47.  
  48.  
  49.  
  50. <p><?php echo $query ?></p>
  51. Zoekterm: <input type="text" name="zoekwoord"><button>Zoeken</button>
  52. <table>
  53. <tr>
  54. <th>
  55. Jokeid
  56. </th>
  57. <th>
  58. Joketext
  59. </th>
  60. <th>
  61. Jokeclou
  62. </th>
  63. <th>
  64. Jokedate
  65. </th>
  66. </tr>
  67. <?php
  68. while ($row = $jokes->fetch(PDO::FETCH_ASSOC))
  69. {
  70. // Result wegschrijven in de $aJokes array
  71. echo "<tr>";
  72. echo "<td><a href='template.php?gebruikersnaam=". $row["userName"]. "'>" . $row["userName"] . "</a></td>";
  73. echo "<td>" . $row["userPassword"] . "</td>";
  74. echo "</tr>";
  75. }
  76. ?>
  77. </table>
  78. <?php
  79. include ("../../../Hoofdstuk 4/Opdracht 4.1/footer.php");
  80. ?>
  81. </form>
  82. </body>
  83. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement