-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_profile_pic.php
88 lines (60 loc) · 1.56 KB
/
update_profile_pic.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
include('connection.php');
extract($_POST);
if(isset($save)){
//image
$imageName=$_FILES['img']['name'];
//$utyp='STUDENT';
$utype='1';
$query="update user set image='$imageName' where id='$uid';";
mysqli_query($conn,$query);
//upload image
//echo $email;
$path="images/$umail/".basename($_FILES["img"]["name"]);
move_uploaded_file($image=$_FILES["img"]["tmp_name"],$path);
echo "
<div class='alert alert-primary'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b> successfully Updated </b>
</div>
";
}
?>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-10">
<div class="panel panel-info">
<div class="panel-heading">Update Profile Pic</div>
<div class="panel-body">
<form method="post" enctype="multipart/form-data">
<div class="row">
<br><br>
<div class="col-md-12" id="login_msg">
<?php echo($err) ?>
</div>
</div>
<div class="row">
<div class="col-md-12">
<tr>
<td><label><b>Select Your Profile pic:</b></label></td>
<td><input type="file" class="form-control" name="img" id="imageselect"></td>
</tr>
</div>
</div>
<br><br>
<div class="row">
<div class="col-md-12">
<input name="save" type="submit" value="Update Profile" class="btn btn-lg btn-success ">
</div>
</div>
</div>
</form>
</div>
<div class="col-md-1"></div>
</div>
</div>
<script>
if ( window.history.replaceState ) {
window.history.replaceState( null, null, window.location.href );
}
</script>