-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
68 lines (62 loc) · 2.16 KB
/
index.php
File metadata and controls
68 lines (62 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
include("top.html");
include("adventure_shared.php");
?>
<p>Welcome to the Adventure Recommender -- the web site for discriminating traveller
needing ideas! Choose the demographics of a place you'd like to visit and we'll
recommend countries for you to adventure to!!</p>
<form action="adventure_recommendations.php" method="get">
<div>
<h2>Which continent(s) do you prefer to travel to?</h2>
<select name="continent[]" size="5" multiple="multiple">
<option value="Anywhere" selected=’selected’>Anywhere</option>
<?php
$sql = "SELECT DISTINCT continent FROM countries ORDER BY continent";
$query = $db->prepare($sql); //prepares the query
$query->execute(); //runs the query
$rows = $query->fetchAll();
foreach($rows as $row){
$choice = $row["continent"];
?>
<option value="<?= $choice ?>"><?= $choice ?></option><?php
}
?>
</select>
</div>
<div>
<h2>Which language(s) do you prefer?</h2>
<select name="languages[]" size="5" multiple="multiple">
<option value="Any language" selected=’selected’>Any Language</option>
<?php //from here
$sql = "SELECT DISTINCT language FROM languages ORDER BY language";
$query = $db->prepare($sql); //prepares the query
$query->execute(); //runs the query
$rows = $query->fetchAll();
foreach($rows as $row){
$choice = $row["language"];
?>
<option value="<?= $choice ?>"><?= $choice ?></option><?php
}
?> //to here
</select>
</div>
<div>
<h2>Do you prefer a developed or undeveloped country</h2>
<input type="radio" name="development" value="developed">Developed
<input type="radio" name="development" value="developing">Developing
<input type="radio" name="development" value="either" checked="true">Don't Mind<br>
</div>
<div>
<input type="submit" value="Submit" />
</div>
</form>
<form action="screenshot1.html" method="get">
<input type="submit" value="Adventure Screenshot" />
</form>
<form action="data.php" method="get">
<input type="submit" name="command" value="cities" />
<input type="submit" name="command" value="countries" />
<input type="submit" name="command" value="languages" />
</form>
</body>
</html>