-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_profile.php
59 lines (48 loc) · 1.45 KB
/
update_profile.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
<?php
require 'includes/header.php';
require 'db/conn.php';
if(!isset($_SESSION["username"]) && !isset($_SESSION["email"])) {
header("location: login.php");
}
if(isset($_POST["submit"]) && $_SESSION["email"]) {
$email = $_SESSION["email"];
$name = $_POST["name"];
$phone = $_POST["phone"];
// $img_path = $_POST["img_path"];
$about = $_POST["about"];
$expertise = $_POST["expertise"];
$industries = $_POST["industries"];
$linkedin = $_POST["linkedin"];
$github = $_POST["github"];
$tweeter = $_POST["tweeter"];
$isUpdated = updateUserInfo($conn, $email, $name, $phone, $about, $expertise, $industries, $linkedin, $github, $tweeter);
if(isset($_FILES['pfp'])) {
// echo "
// <script>
// alert('updating your profile picture.');
// </script>
// ";
$file = $_FILES['pfp'];
$isUploaded = updateUserProfile($conn, $email, $file);
if($isUploaded) {
echo "
<script>
alert('Profile picture uploaded successfully.');
</script>
";
}
}
if($isUpdated) {
echo "
<script>
window.location.href='profile.php';
alert('Information updated successfully.');
</script>
";
// header("location: profile.php");
}
else {
echo "error in updation->".mysqli_error();
}
}
?>