-
Notifications
You must be signed in to change notification settings - Fork 1
/
userInfo.php
executable file
·79 lines (57 loc) · 1.8 KB
/
userInfo.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
//error_reporting(E_ALL);
ini_set("display_errors", 1);
//include("file_with_errors.php");
//error_reporting(E_ERROR);
include_once("DBconnect.php");
// to inset into recipe table
$error= "";
function cleanData($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
/*
if(isset($_POST["username"]) && isset($_POST["firstname"])&& isset($_POST["email"])) {
echo $_POST["username"];
echo $_POST["firstname"];
echo $_POST["lastname"];
echo $_POST["email"];
echo $_POST["phone"];
echo $_POST["height"];
echo $_POST["weight"];
echo $_POST["age"];
echo $_POST["lifestyle"];
echo $_POST["gender"];
}
*/
if(isset($_GET["username"]))
$username = $_GET["username"];
if(isset($_POST["firstname"]))
$firstname = $_POST["firstname"];
if(isset($_POST["lastname"]))
$lastname = $_POST["lastname"];
if(isset($_POST["email"]))
$email = $_POST["email"];
//$uphoto = addslashes(file_get_contents($_FILES['uphoto']['tmp_name']));
if(isset($_POST["phone"]))
$phone = $_POST["phone"];
if(isset($_POST["gender"]))
$gender = $_POST["gender"];
//$dateOfBirth = date('Y-m-d', strtotime($dateOfBirth));
if(isset($_POST["age"]))
$age = $_POST["age"];
if(isset($_POST["height"]))
$height =$_POST["height"];
if(isset($_POST["weight"]))
$weight=$_POST["weight"];
if(isset($_POST["lifestyle"]))
$lifestyle=$_POST["lifestyle"];
$sql ="update userprofile set firstname='$firstname', lastname='$lastname', email='$email', phone=$phone, gender='$gender', age=$age, height=$height, weight=$weight,lifestyle=$lifestyle where username = '$username';";
// echo $sql;
$execute_sql_log=mysqli_query($conn,$sql);
if($execute_sql_log)
header("Location: updateprofile.php");
?>