-
Notifications
You must be signed in to change notification settings - Fork 23
/
add.php
49 lines (38 loc) · 1.52 KB
/
add.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
<?php
include('config.php');
if(isset($_POST['submit'])){
$u_card = $_POST['card_no'];
$u_f_name = $_POST['user_first_name'];
$u_l_name = $_POST['user_last_name'];
$u_father = $_POST['user_father'];
$u_aadhar = $_POST['user_aadhar'];
$u_birthday = $_POST['user_dob'];
$u_gender = $_POST['user_gender'];
$u_email = $_POST['user_email'];
$u_phone = $_POST['user_phone'];
$u_state = $_POST['state'];
$u_dist = $_POST['dist'];
$u_village = $_POST['village'];
$u_police = $_POST['police_station'];
$u_pincode = $_POST['pincode'];
$u_mother = $_POST['user_mother'];
$u_family = $_POST['family'];
$u_staff_id = $_POST['staff_id'];
//image upload
$msg = "";
$image = $_FILES['image']['name'];
$target = "upload_images/".basename($image);
if (move_uploaded_file($_FILES['image']['tmp_name'], $target)) {
$msg = "Image uploaded successfully";
}else{
$msg = "Failed to upload image";
}
$insert_data = "INSERT INTO student_data(u_card, u_f_name, u_l_name, u_father, u_aadhar, u_birthday, u_gender, u_email, u_phone, u_state, u_dist, u_village, u_police, u_pincode, u_mother, u_family, staff_id,image,uploaded) VALUES ('$u_card','$u_f_name','$u_l_name','$u_father','$u_aadhar','$u_birthday','$u_gender','$u_email','$u_phone','$u_state','$u_dist','$u_village','$u_police','$u_pincode','$u_mother','$u_family','$u_staff_id','$image',NOW())";
$run_data = mysqli_query($con,$insert_data);
if($run_data){
$added = true;
}else{
echo "Data not insert";
}
}
?>