-
Notifications
You must be signed in to change notification settings - Fork 0
/
student_avatar.php
24 lines (15 loc) · 956 Bytes
/
student_avatar.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
<?php
include('admin/dbcon.php');
include('session.php');
if (isset($_POST['change'])) {
$image = addslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_name = addslashes($_FILES['image']['name']);
$image_size = getimagesize($_FILES['image']['tmp_name']);
move_uploaded_file($_FILES["image"]["tmp_name"], "admin/uploads/" . $_FILES["image"]["name"]);
$location = "uploads/" . $_FILES["image"]["name"];
mysqli_query($conn,"update student set location = '$location' where student_id = '$session_id' ")or die(mysqli_error());
?>
<script>
window.location = "dashboard_student.php";
</script>
<?php } ?>