-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddaccount.php
42 lines (30 loc) · 1.1 KB
/
addaccount.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
<?php
include('connection.php');
session_start();
$user= $_SESSION['furnitureuser'];
$name=$_POST['name'];
$email=$_POST['email'];
$pass=$_POST['pass'];
$fname=$_POST['fname'];
$mname=$_POST['mname'];
$lname=$_POST['lname'];
$addr1=$_POST['addr1'];
$addr2=$_POST['addr2'];
$state=$_POST['state'];
$city=$_POST['city'];
$zip=$_POST['zip'];
$ph=$_POST['ph'];
$mph=$_POST['mph'];
$fax=$_POST['fax'];
try {
$sql = $conn->prepare("INSERT INTO `customer` (`display`, `email`, `pass`, `firstname`, `middlename`, `lastname`, `addr1`, `addr2`, `zip`, `city`, `state`, `phone`, `mobile`, `fax`) VALUES ('$name', '$email', '$pass', '$fname', '$mname', '$lname', '$addr1', '$addr2', '$zip', '$city', '$state', '$ph', '$mph', '$fax')");
$sql->execute();
$sql1 = $conn->prepare("update cart set user='$name' where user='$user'");
$sql1->execute();
$_SESSION['furnitureuser']=$name;
}
catch(PDOException $e) {
echo $e->getMessage();
}
header("location:login.php");
?>