-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathprofilepic.php
More file actions
executable file
·62 lines (60 loc) · 2.15 KB
/
Copy pathprofilepic.php
File metadata and controls
executable file
·62 lines (60 loc) · 2.15 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Profile Picture Update</title>
</head>
<body onload="deleteimg();">
<?php
require "header.php";
require "prevent_login.php";
require "includes/dbh.inc.php";
$roll = $_SESSION['roll'];
$sql = "SELECT * FROM profileimg WHERE user_rno=$roll";
$result = mysqli_query($conn, $sql);
if ($row = mysqli_fetch_assoc($result)){
$status = $row['status_name'];
}else{
echo "Try Again!";
}
if(isset($_GET['delete'])){
if($_GET['delete'] == 'success'){
echo "<h4>Profile picture deleted successfully!</h4>";
}
}
?>
<div class = "container">
<h3 class ="heading">Select Profile Picture</h3>
<section class="entry">
<p>.jpg/.jpeg/.png (within 500kb)</p><br><br>
<form action="includes/profilepic.inc.php" method="post" enctype="multipart/form-data">
<input type="file" name="picture"><br><br>
<button class="submit-buttons" type="submit" name="change-pic-submit">Upload Image</button>
</form>
</section><br><br>
<section class="entry" id = "deleteimg-section">
<p>Delete Profile Picture</p>
<form action="includes/profilepic.inc.php" method="post" enctype="multipart/form-data">
<button class="submit-buttons" id="button" type="submit" name="delete-pic-submit">Delete Image</button>
</form>
</section>
<script>
var status = <?=json_encode($status)?>;
var deleteImg = document.getElementById("deleteimg-section");
function deleteimg(){
if(status == 1){
deleteImg.style.display = "none";
}
else{
deleteImg.style.display = "inline-block";
}
}
</script>
</div>
<?php
require "nav-bar.php";
require "footer.php";
?>
</body>
</html>