-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdate_semi.php
45 lines (35 loc) · 1.23 KB
/
update_semi.php
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
<!--
File Name: update_semi.php
Author's Name: Sukhdeep Singh, Nav Bhullar
Web Site Name: Tourney Bracket
File Description: This page Takes the input from the semi_final.php page and makes the updation to the database
-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Update Semi Final Winners</title>
</head>
<body>
<div class="container">
<?php
//access current session
session_start();
//evaluate the user_id stored in the session that was set on validate.php
if (empty($_SESSION['user_id'])) {
header('Location:index.php');
} else {
$conn = mysqli_connect('webdesign4', 'dbxxxxxxxxx', 'xxxxx', 'dbxxxxxxxxx') or die('Error connecting to MySQL server');
$semi1 = $_POST['semi1'];
$semi2 = $_POST['semi2'];
$id = $_POST['id'];
$conn = mysqli_connect('webdesign4', 'dbxxxxxxxxx', 'xxxxx', 'dbxxxxxxxxx') or die('Error connecting to MySQL server');
$query = 'UPDATE tournaments SET semi1 = "'.$semi1.'", semi2 = "'.$semi2.'" WHERE id = "'.$id.'"';
mysqli_query($conn, $query) or die('Error querying database.');
mysqli_close($conn);
header('Location: final.php?id='.$id);
}
?>
</div>
</body>
</html>