-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckeditprofile.php
More file actions
47 lines (38 loc) · 1.18 KB
/
checkeditprofile.php
File metadata and controls
47 lines (38 loc) · 1.18 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
39
40
41
42
43
44
45
46
47
<?php
session_start();
$host="localhost";
$user="root";
$password="";
$db="simplilearn";
$conn=mysqli_connect("$host","$user","$password","$db");
if($conn)
{
$var=$_SESSION['name'];
$sq="SELECT * from registration where username='$var' ";
$retval=mysqli_query($conn,$sq);
$row=mysqli_fetch_assoc($retval);
$user=$_POST['user'];
$firstname=$_POST['first'];
$lastname=$_POST['last'];
$gender=$_POST['gender'];
$phone=$_POST['phone'];
$address=$_POST['address'];
$city=$_POST['city'];
$state=$_POST['state'];
$birthdate=$_POST['date'];
if(empty($birthdate))
{
$birthdate=$row['birthdate'];
}
$occupation=$_POST['occupation'];
$university=$_POST['university'];
$skills=$_POST['Skills'];
$work=$_POST['Work'];
$sql="UPDATE registration SET lastname='$lastname',gender='$gender',Phone='$phone',address='$address',city='$city',
Firstname='$firstname',birthdate='$birthdate' WHERE username='$user' ";
$retval=mysqli_query($conn,$sql);
$sql="UPDATE education SET occupation='$occupation',university='$university',Skills='$skills',Work='$work' WHERE username='$user' ";
$retval=mysqli_query($conn,$sql);
header('location:profilepage.php');
}
?>