-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathregora.php
More file actions
executable file
·36 lines (32 loc) · 1.03 KB
/
regora.php
File metadata and controls
executable file
·36 lines (32 loc) · 1.03 KB
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
<?php
require('includes/functions.php');
if(isset($_POST['name']) && $_POST['name']!=''){
$name=sanitize_input($_POST['name']);
$mail=sanitize_input($_POST['email']);
$mobile=sanitize_input($_POST['mobile']);
$designation=sanitize_input($_POST['designation']);
$clgid=sanitize_input($_POST['clgid']);
$branch=sanitize_input($_POST['branch']);
$clg=sanitize_input($_POST['clgname']);
$post_data = [
'uid' => '', // blank for insertion
'name' => $name,
'mail' => $mail,
'mobile' => $mobile,
'role' => '2', // volunteer basic role
'designation' => $designation,
'clgid' => $clgid,
'branch' => $branch,
'clg' => $clg
];
$data = get_api_data_post($api_url . '/global/manage_users', $post_data);
$resp = json_decode($data, true);
if($resp && $resp['status'] == 'success'){
echo "<br>done<br><a href='form.php'>go home</a>";
}else{
echo "API failed to register user.";
}
}else{
echo "Validation failed.";
}
?>