-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapprove.php
34 lines (28 loc) · 911 Bytes
/
approve.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
<?php
session_start();
error_reporting(E_ERROR | E_PARSE);
// If the session vars aren't set, try to set them with a cookie
if (!isset($_SESSION['user_id'])) {
if (isset($_COOKIE['user_id']) && isset($_COOKIE['username'])) {
$_SESSION['user_id'] = $_COOKIE['user_id'];
$_SESSION['username'] = $_COOKIE['username'];
}
}
?>
<?php
$host = "localhost";
$user = "root";
$pass = "";
$database = "linust_f";
/*Connection Functions*/
$link = mysqli_connect($host,$user,$pass) or die ("Connection was unsuccessful");
mysqli_select_db($link,$database);
$id = $_GET['id'];
$type = $_GET['type'];
if($type=='CourseWork')
$sqlQuery = "UPDATE file_upload SET status=1 WHERE file_id='$id'";
else if($type=='RelatedLink')
$sqlQuery = "UPDATE url_upload SET status=1 WHERE url_id='$id'";
mysqli_query($link,$sqlQuery);
header("Location:adminpanel.php");
?>