} if ($user_type == 0) { header("Location:/" . $redirect . "?error=5"); die; } // if(!preg_match('^[0-9]{10}', $contact)){ // header("Location:/". $redirect."?error=6"); // die(); // } // if($rDB->checkUserName($user_name)){ // header("Location:/".$redirect."?error=7"); // die(); // } //For HOD user_type=2 //Faculty Advisor user_type=3 //Office Staff user_type=4 //Student user_type=5 //For Office Staff Department id is equal to 0 that means they don't belong to any department if ($user_type == 2) { $rDB->insertUser($fname, $lname, $user_type, $email, $department, $pass1, $contact, $sex, $activated); } elseif ($user_type == 3) { $rDB->insertUser($fname, $lname, $user_type, $email, $department, $pass1, $contact, $sex, $activated); } elseif ($user_type == 4) { $rDB->insertUser($fname, $lname, $user_type, $email, $department, $pass1, $contact, $sex, $activated); } elseif ($user_type == 5) { $student_id = $rDB->insertUser($fname, $lname, $user_type, $email, $department, $pass1, $contact, $sex, $activated); if (isset($student_id)) { $rDB->insertStudentInfo($student_id, $roll_number, $category); } } header("Location:done.php?act=1");