-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdd_Registration.php
66 lines (42 loc) · 1.51 KB
/
Add_Registration.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
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
/*print_r($_POST);*/
if(isset($_POST['superid'])){
$s= trim($_POST['superid']);
$a= trim($_POST['NIC']);
$b=trim($_POST['First'] ) ;
$c=trim($_POST['Last']) ;
$d= trim($_POST['Password']);
$e=trim($_POST['Email']);
$f= trim($_POST['Cont_No'] );
$g= trim($_POST['Address'] );
$query = "INSERT INTO user(NIC,First,Last,Password,Email,Cont_No,Address,Super_ID)
VALUES('$a','$b','$c','$d','$e','$f','$g','$s');
";
}else{
$v_no=implode("|",$_POST["V_No"]);
$a= trim($_POST['NIC']);
$b=trim($_POST['First'] ) ;
$c=trim($_POST['Last']) ;
$d= trim($_POST['Password']);
$e=trim($_POST['Email']);
$f= trim($_POST['Cont_No'] );
$g= trim($_POST['Address'] );
$query = "INSERT INTO user(NIC,First,Last,Password,Email,Cont_No,Address,Vehical_No)
VALUES('$a','$b','$c','$d','$e','$f','$g','$v_no');
";
}
include("PHP.php");
$add = new Database();
$result = $add->Query($query) ;
if ($result) {
$msg['success']='Registration successfully';
echo json_encode($msg) ;
} else {
$errno=$add->geterrno();
$msg['errno']=$errno;
echo json_encode($msg) ;
}
}
exit();
?>