-
Notifications
You must be signed in to change notification settings - Fork 0
/
change_profile.php
30 lines (27 loc) · 1.17 KB
/
change_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
<?php
#####################################################################
#
# File : CHANGE PROFILE
# Project : Game Magazine Project
# Author : Béo Sagittarius
# Created : 07/01/2015
#
##################################################################### -->
include('includes/backend/mysqli_connect.php');
include('includes/functions.php');
if (isset($_POST)) {
$uid = $_SESSION['uid'];
$first_name = mysqli_real_escape_string($dbc, $_POST['firstname']);
$last_name = mysqli_real_escape_string($dbc, $_POST['lastname']);
$website = mysqli_real_escape_string($dbc, $_POST['website']);
$bio = mysqli_real_escape_string($dbc, $_POST['bio']);
$datepost = $_POST['dateofbirth'];
$date = DateTime::createFromFormat('d-m-Y', $datepost);
$dateofbirth = $date->format('Y-m-d H:i:s');
$result = change_profile($uid, $first_name, $last_name, $website, $bio, $dateofbirth);
if (mysqli_affected_rows($dbc) == 1) {
echo json_encode(['status' => 'OK']);
}else {
echo json_encode(['status' => 'FAIL']);
}
}