forked from richasdy/CodeIgniter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.php
More file actions
29 lines (25 loc) · 856 Bytes
/
Copy pathedit.php
File metadata and controls
29 lines (25 loc) · 856 Bytes
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
<?php
session_start();
include "koneksi.php";
function update($data,$connect){
$id = $_SESSION["id"];
$name = $data["name"];
$username = $data["username"];
$website = $data["website"];
$bio = $data["bio"];
$email = $data["email"];
$phone_number = $data["phone_number"];
$gender = $data["gender"];
$hasil = "UPDATE profile SET name='$name', username='$username', website='$website', bio='$bio', email='$email', phone_number='$phone_number', gender='$gender' WHERE id='$id' ";
$hasil2 = "UPDATE user_login SET username='$username', email='$email' WHERE id='$id' ";
$query = mysqli_query($connect, $hasil);
return $query;
}
if (isset($_POST["submit"])) {
if (update($_POST, $connect)) {
header("Location: profile.php");
} else {
header("Location: edit-profile.php");
}
}
?>