-
Notifications
You must be signed in to change notification settings - Fork 3
/
functions.php
40 lines (23 loc) · 935 Bytes
/
functions.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
<?php
session_start();
function Update_Profile($ID, $full_name, $user_name, $email_address, $facebook, $whatsapp, $bio)
{
include 'config.php';
$insert_query = "UPDATE users SET FULL_NAME = '$full_name', USER_NAME = '$user_name' ,EMAIL = '$email_address', FACEBOOK = '$facebook', WHATSAPP = '$whatsapp', BIO = '$bio' WHERE User_ID = $ID ;";
$stmt = $conn->prepare($insert_query);
if ($stmt->execute()) {
$_SESSION['id'] = $ID;
$_SESSION['username'] = $user_name;
$_SESSION['fullname'] = $full_name;
$_SESSION['email'] = $email_address;
$_SESSION['facebook'] = $facebook;
$_SESSION['whatsapp'] = $whatsapp;
$_SESSION['bio'] = $bio;
header("location: my_Profile.php?success_message=Profile Updated Successfully");
exit;
} else {
header("location: edit-profile.php?error_message=error Occurred");
exit;
}
}
?>