forked from IT-DEPT-ASPL/HRMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateupload.php
More file actions
30 lines (22 loc) · 838 Bytes
/
createupload.php
File metadata and controls
30 lines (22 loc) · 838 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
29
30
<?php
@include 'inc/config.php';
$name = mysqli_real_escape_string($con,trim($_POST['name']));
$email = mysqli_real_escape_string($con, trim($_POST['email']));
$pass = md5($_POST['password']);
$cpass = md5($_POST['cpassword']);
$user_type = $_POST['user_type'];
$empstatus = $_POST['empstatus'];
$select = " SELECT * FROM user_form WHERE email = '$email'";
$result = mysqli_query($con, $select);
if(mysqli_num_rows($result) > 0){
$error[] = 'User already exist!';
}else{
if($pass != $cpass){
$error[] = 'password not matched!';
}else{
$insert = "INSERT INTO user_form(name, email, password, user_type,empstatus) VALUES('$name','$email','$pass','$user_type','$empstatus')";
mysqli_query($con, $insert);
echo $insert?'ok':'err';
}
}
?>