Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>You have selected</title>
  4. </head>
  5. <body>
  6.  
  7. <style>
  8. body {background-image: url("margarita cookies.jpg")}
  9. </style>
  10.  
  11. <?php
  12. $host="localhost";
  13. $username="alcohaul";
  14. $password="drunk";
  15. $database="alcohaul";
  16. $link= mysqli_connect($host,$username,$password,$database);
  17. $select='SELECT * FROM master';
  18.  
  19. if (isset($_GET['type']) || isset($_GET['happy_hour']) || isset($_GET['flavor']) || isset($_GET['area']) || isset($_GET['rest'])){
  20. $select.=' where';
  21. }
  22.  
  23. if (isset($_GET['type']) && ($_GET['type'] != ' ')){
  24. $select.=' type_id = ' . $_GET['type'];
  25. if (isset($_GET['happy_hour']) || isset($_GET['flavor']) || isset($_GET['area']) || isset($_GET['rest'])){
  26. $select.=' and';
  27. }
  28. }
  29. if (isset($_GET['happy_hour']) && ($_GET['happy_hour] !=' ')){
  30. $select.=' happy_hour_id = ' . $_GET['happy_hour'];
  31. if (isset($_GET['flavor']) || isset($_GET['area']) || isset($_GET['rest'])){
  32. $select.=' and';
  33. }
  34. }
  35. if (isset($_GET['flavor']) && ($_GET['flavor'] !=' ')){
  36. $select.=' flavor_id = ' . $_GET['flavor'];
  37. if (isset($_GET['area']) || isset($_GET['rest'])){
  38. $select.=' and';
  39. }
  40. }
  41. if (isset($_GET['area']) && ($_GET['area'] !=' ')){
  42. $select.=' area_id = ' . $_GET['area'];
  43. if (isset($_GET['rest'])){
  44. $select.=' and';
  45. }
  46. }
  47. if (isset($_GET['rest']) && ($_GET['rest'] !=' ')){
  48. $select.=' rest_id = ' . $_GET['area'] . ;
  49. }
  50.  
  51.  
  52.  
  53. $search=mysqli_query($link,$select);
  54. while ($row=mysqli_fetch_array($search)) {
  55. print "$row[master_id]<br/>";
  56. }
  57.  
  58. mysqli_close($link);
  59.  
  60. ?>
  61. </body>
  62. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement