Advertisement
Guest User

Untitled

a guest
Nov 28th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Pick Your Poison</title>
  4. </head>
  5. <body>
  6.  
  7. <style>
  8. body {background-image: url("margarita cookies.jpg")}
  9. h1 {text-align: center}
  10. h3 {margin-left: 30px}
  11. </style>
  12.  
  13. <?php
  14. $host="localhost";
  15. $username="alcohaul";
  16. $password="drunk";
  17. $database="alcohaul";
  18. $link= mysqli_connect($host,$username,$password,$database);
  19.  
  20. print "<h1>Pick Your Poison</h1>";
  21.  
  22. print "<form method=GET action='practiceresults.php'>";
  23. print "<h3>Consistency: <select name='type'>";
  24. $typeresult= mysqli_query($link, 'SELECT * FROM type');
  25. print "<option value='No preference'></option>";
  26. while ($row = mysqli_fetch_array($typeresult)){
  27. print "<option value='$row[type_id]'> $row[type]</option>";
  28. }
  29. print "</select><br />";
  30.  
  31. print "Happy Hour Availability: <select name='happy_hour'>";
  32. $hhresult= mysqli_query($link, 'SELECT * FROM happy_hour');
  33. print "<option value='No preference'></option>";
  34. while ($row = mysqli_fetch_array($hhresult)){
  35. print "<option value='$row[hh_id]'> $row[hh]</option>";
  36. }
  37. print "</select><br />";
  38.  
  39. print "Flavor: <select name='flavor'>";
  40. $flavorresult= mysqli_query($link, 'SELECT * FROM flavor ORDER BY flavor');
  41. print "<option value='No preference'></option>";
  42. while ($row = mysqli_fetch_array($flavorresult)){
  43. print "<option value='$row[flavor_id]'> $row[flavor]</option>";
  44. }
  45. print "</select><br />";
  46.  
  47. print "Restaurant Area: <select name='area'>";
  48. $arearesult= mysqli_query($link, 'SELECT * FROM area ORDER BY area');
  49. print "<option value='No preference'></option>";
  50. while ($row = mysqli_fetch_array($arearesult)){
  51. print "<option value='$row[area_id]'> $row[area]</option>";
  52. }
  53. print "</select><br />";
  54.  
  55. print "Restaurant Name: <select name='rest'>";
  56. $restresult= mysqli_query($link, 'SELECT * FROM rest ORDER BY rest');
  57. print "<option value='No preference'></option>";
  58. while ($row = mysqli_fetch_array($restresult)){
  59. print "<option value='$row[rest_id]'> $row[rest]</option>";
  60. }
  61. print "</select><br><input type='submit' value='Pick or Browse All'></form></h3>";
  62.  
  63. mysqli_close($link);
  64. ?>
  65. </body>
  66. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement