-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex1.1
More file actions
39 lines (34 loc) · 1.01 KB
/
index1.1
File metadata and controls
39 lines (34 loc) · 1.01 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
<?php
/**
*index.php
*CS50 2014 Final
*
*Jake Morrissey
*jakemorrissey@college.harvard.edu
*
*main page, displays portfolio and links
*/
// configuration
require("../includes/config.php");
if ($_SERVER["REQUEST_METHOD"] == "GET")
{
$rows1 = query("SELECT college FROM colleges WHERE 1");
$positions = [];
foreach($rows1 as $row1)
{
$positions[] = [
"college" => $row1["college"]
];
}
render("template2.php", ["positions" => $positions, "title" => "Compare"]);
}
else if($_SERVER["REQUEST_METHOD"] == "POST")
{
$college = $_POST["collegeselect"];
$college2 = $_POST["collegeselect2"];
// gets portfolio information belonging to user
$rows = query("SELECT * FROM colleges WHERE college = ?", $college);
$rows2 = query("SELECT * FROM colleges WHERE college = ?", $college2);
render("template3.php", ["rows" => $rows, "rows2" => $rows2]);
}
?>