Bazaga kiritilgan foydalanuvchilar ro`yhati()
";echo "T/r | Familiyasi, ismi va sharifi | Login | Parol | Huquqi | Amallar | ";$ta = 1; while($row = mysqli_fetch_array($natijafoy)) { if ($row['role']=='user') { echo "".$ta++." | ".$row['name']." | ".$row['username']." | ".$row['password']." | ".$row['role']." | O`chirish | "; } } }//foydalanuvchilar if($_GET['act']=='foydalanuvchi') {echo ' Professor-o`qituvchilar bazaga qo`shish Fanlar bazaga qo`shish Foydalanuvchi Professor-o`qituvchilar yaratish Foydalanuvchi talabalarni yaratish '; }//foydalanuvchini saqlash if (isset($_POST['register_btn'])) {/*tekshirish uchun korib olish*///echo $name."
".$login."
".$role."
".$password_1."
".$password_2;if (($_POST['username']!='')&&($_POST['login']!='')&&($_POST['user_type']!='')&&($_POST['password_1']!='')) { $name = $_POST['username']; $login = $_POST['login']; $role = $_POST['user_type']; $password_1 = $_POST['password_1']; $password_2 = $_POST['password_2']; $royhatibor='yuq';$oqituvchilarni=mysqli_query($conn,'SELECT name FROM foydalananuvchi'); while($row=mysqli_fetch_assoc($oqituvchilarni)){ if ($row['name']==$name) {$royhatibor='bor';$fish=$row['name']; ;}}if ($royhatibor=='yuq') { if ( $_POST['password_1']==$_POST['password_2']) { $sql = "INSERT INTO `foydalananuvchi` (`id`, `name`, `username`, `password`, `role`) VALUES (NULL, '$name', '$login', '$password_1', '$role')"; mysqli_query($conn, "INSERT INTO users(`id`,`name`,`login`,`pass`) VALUES(NULL,'$name','$login',$password_1)"); //mysqli_query($conn, "INSERT INTO users(`id`,`name`) VALUES(NULL,'$name')"); if ($conn->query($sql) === TRUE) { echo "
Do'stlaringiz bilan baham: |