prepare("SELECT id FROM students WHERE mobile = ? OR email = ?"); $chk_stmt->bind_param("ss", $mobile, $email); $chk_stmt->execute(); $chk_result = $chk_stmt->get_result(); if($chk_result->num_rows == 0) { // फोटो अपलोड लॉजिक $image = ''; $img = photo_upload('image', 'students'); if($img['status']){ $image = $img['file_name']; } // सिग्नेचर अपलोड लॉजिक $sign = ''; $signature = photo_upload('sign', 'students'); if($signature['status']){ $sign = $signature['file_name']; } // 2. पासवर्ड सिक्योरिटी (Hashing) $hashed_password = password_hash($_POST['password'], PASSWORD_BCRYPT); $enrollment_no = student_last_id(); // 3. Prepared Statement के साथ सुरक्षित INSERT क्वेरी $insert_query = "INSERT INTO `students` ( `dur_start`, `id`, `timestamp`, `enrollment_no`, `name`, `gender`, `father`, `mother`, `dob`, `mobile`, `email`, `address`, `state`, `distric`, `exam_pass`, `marks`, `board`, `year`, `username`, `password`, `course_id`, `center_id`, `photo`, `sign`, `status` ) VALUES (?, NULL, CURRENT_TIMESTAMP, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '0')"; $ins_stmt = $con->prepare($insert_query); // सभी पोस्ट डेटा को सुरक्षित रूप से बाइंड करना $ins_stmt->bind_param( "ssssssssssssssssssssss", $_POST['dur_start'], $enrollment_no, $_POST['name'], $_POST['gender'], $_POST['father'], $_POST['mother'], $_POST['dob'], $mobile, $email, $_POST['address'], $_POST['state'], $_POST['distric'], $_POST['exam_pass'], $_POST['marks'], $_POST['board'], $_POST['year'], $_POST['username'], $hashed_password, $_POST['course_id'], $_POST['center_id'], $image, $sign ); if($ins_stmt->execute()){ $id = $con->insert_id; echo ''; exit; } else { echo ''; } } else{ echo ''; } } ?>

Registration Form

Please fill in all the required details carefully.