forked from nizaranand/FaceLink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_process.php
59 lines (31 loc) · 1.45 KB
/
edit_process.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
<?php
/**
* index.php
*
*Facelink home page with registration and login form
*
* Written by: Monideep a.k.a. deep The Grandmaster of PHP
*
*/
include_once 'session.php';
$u_first_name=$_POST[u_first_name];
$u_last_name=$_POST['u_last_name'];
$u_gender=$_POST['u_gender'];
$u_country=$_POST['u_country'];
$u_about=$_POST['u_about'];
$u_city=$_POST['u_city'];
$u_town=$_POST['u_town'];
$u_language=$_POST['u_language'];
$insert="UPDATE users SET first_name='$u_first_name',last_name='$u_last_name',gender='$u_gender',country='$u_country' WHERE username='$session->username'";
$up=mysql_query($insert);
$insert2="UPDATE profile SET about='$u_about', city='$u_city',town='$u_town',language='$u_language' where uname='$session->username'";
$up2=mysql_query($insert2);
if(! $up && ! $up2)
{
$_SESSION['profile_err']="Error occoured during the update process!! try again later";
}
else{
$_SESSION['profile_err']="Your profile has been successfully updated";
}
header("location:edit_profile.php");
?>