source: SetUserAdmin.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 6 days ago

Upload project files

  • Property mode set to 100644
File size: 537 bytes
Line 
1<?php
2
3 if(!isset($_SESSION['user_ID']) || !isset($_SESSION['is_admin']) || !$_SESSION['is_admin']) {
4 header("Location: ./Log In.php");
5 }
6
7 require "./connect.php";
8
9 if(!isset($_GET['user_id'])) {
10 header("location: ./Users.php");
11 exit();
12 }
13
14 $res = $conn->query("SELECT * FROM users WHERE user_ID=".$_GET['user_id'].";");
15
16 if($res->num_rows >= 1) {
17 $conn->query('UPDATE users SET is_admin = 1 WHERE user_ID = '.$_GET["user_id"].';');
18 }
19
20 header("location: ./Users.php");
21?>
Note: See TracBrowser for help on using the repository browser.