forked from HSJared/Social-Network
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateprofile.php
48 lines (43 loc) · 1.49 KB
/
updateprofile.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
<?php
session_start();
###Connect to database###
include("config.php");
$userid = $_SESSION['userid'];
if(isset($_GET['mname']))
{
$mname = $_GET['mname'];
$sql = "UPDATE userinfo SET mname = '$mname' WHERE userid = $userid;";
$result=mysql_query($sql,$conc) or die("Unable to insert userinfo into db");
header("location: home.php");
}
if(isset($_GET['nickname']))
{
$nickname = $_GET['nickname'];
$sql = "UPDATE userinfo SET nickname =$nicknamewhere userid = $userid;";
$result=mysql_query($sql,$conc) or die("Unable to insert userinfo into db");
header("location: home.php");
}
if(isset($_GET['phonenum']))
{
$phonenum = $_GET['phonenum'];
$sql = "UPDATE userinfo SET phonenum = $phonenum WHERE userid = $userid;";
$result=mysql_query($sql,$conc) or die("Unable to insert userinfo into db");
header("location: home.php");
}
if(isset($_GET['addressline1']))
{
$addressline1 = $_GET['addressline1'];
$city = $_GET['city'];
$state = $_GET['statepro'];
$postalcode = $_GET['postalcode'];
$sql = "UPDATE userinfo SET addressline1 = '$addressline1', city = '$city', state = '$state', postalcode = '$postalcode' where userid = $userid;";
$result=mysql_query($sql,$conc) or die("Unable to insert userinfo into db");
if(!empty($_GET['addressline2']))
{
$addressline2 = $_GET['addressline2'];
$sql = "UPDATE userinfo SET addressline2 = '$addressline2' WHERE userid = $userid;;";
$result=mysql_query($sql,$conc) or die("Unable to insert addressline2 into db");
}
header("location: home.php");
}
?>