forked from richasdy/vietgram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.php
More file actions
23 lines (22 loc) · 971 Bytes
/
Copy pathupdate.php
File metadata and controls
23 lines (22 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
include 'connection.php';
session_start();
if (isset($_POST['submit'])) {
$user = $_GET['user'];
$name = $_POST['name'];
$username = $_POST['username'];
$web = $_POST['website'];
$bio = $_POST['bio'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$gender = $_POST['gender'];
$queryUser = mysqli_query($conn, "UPDATE USERS SET USERNAME = '$username', EMAIL = '$email' WHERE USERNAME = '$user'");
$queryProfile = mysqli_query($conn, "UPDATE PROFILES SET NAME = '$name', WEBSITE = '$web', BIO = '$bio', PHONE_NUMBER = '$phone', GENDER = '$gender' WHERE USERNAME = '$username'");
if ($queryUser && $queryProfile) {
$_SESSION['username'] = $username;
header('location:edit-profile.php');
$_SESSION['status'] = 'success';
} else
echo "<script>alert('Update gagal!')</script>";
}
?>