forked from kalyanm72/Online-Bus-Booking
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_user.php
More file actions
28 lines (24 loc) · 857 Bytes
/
Copy pathcreate_user.php
File metadata and controls
28 lines (24 loc) · 857 Bytes
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
<?php
header('Access-Control-Allow-Origin: *' );
header('Content-Type:application/json' );
header('Access-Control-Allow-Methods: POST ' );
header('Access-Control-Allow-Headers: Access-Control-Allow-Headers,Content-Type,
Access-Control-Allow-Methods,Autherization,X-Requested-with');
include_once 'Database.php';
include_once 'Post_user.php';
$database=new Database();
$db=$database->connect();
$user=new Post_user($db);
$data=json_decode(file_get_contents("php://input"));
$user->username=$data->username;
$user->password=$data->password;
$user->mob=$data->mob;
$user->email=$data->email;
$user->verified=$data->verified;
$user->has_key=$data->has_key;
if($user->create()){
echo json_encode(array('message'=>'User added successfully'));
}
else{
echo json_encode(array('message'=>'User Not added'));
}