-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofileEx.php
More file actions
38 lines (29 loc) · 1.17 KB
/
Copy pathprofileEx.php
File metadata and controls
38 lines (29 loc) · 1.17 KB
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
<?php
include "db_conn.php";
if (isset($_POST['username']) && isset($_POST['password']) && isset($_POST['email']) && isset($_POST['address']) && isset($_POST['yearSection']) && isset($_POST['age']) && isset($_POST['sex']) && isset($_POST['contact'])) {
$username = $_POST["username"];
$password = $_POST["password"];
$email = $_POST["email"];
$address = $_POST["address"];
$yearSection = $_POST["yearSection"];
$age = $_POST["age"];
$sex = $_POST["sex"];
$contact = $_POST["contact"];
$sql1 = "SELECT * FROM `account` WHERE `email` = '$email'";
$result1 = mysqli_query($conn, $sql1);
if ($result1 && mysqli_num_rows($result1) > 0) {
$sql2 = "UPDATE `account` SET `username`='$username',`password`='$password',`address`='$address',`yearSection`='$yearSection',`age`='$age',`sex`='$sex',`contact`='$contact' WHERE `email` = '$email'";
// profile is missing will add later -> ",`profile`='$profile'"
$result2 = mysqli_query($conn, $sql2);
if ($result2){
echo "Success";
} else {
echo "Failed";
}
} else {
echo "Nothing";
}
} else {
echo "Unknown";
}
?>