📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
dk
/
teacher
Dosya Düzenle: delete_question.php
<?php session_start(); include('../config.php'); if(!isset($_SESSION['teacher_id'])){ header("Location: login.php"); exit(); } if(!isset($_GET['qid'])){ header("Location: question_bank.php"); exit(); } $qid = intval($_GET['qid']); // Check if question belongs to teacher $q_res = mysqli_query($conn, "SELECT q.id, e.teacher_id FROM questions q JOIN exams e ON q.exam_id = e.id WHERE q.id='$qid'"); $question = mysqli_fetch_assoc($q_res); if(!$question || $question['teacher_id'] != $_SESSION['teacher_id']){ echo "Question not found!"; exit(); } // Delete question mysqli_query($conn, "DELETE FROM questions WHERE id='$qid'"); header("Location: question_bank.php?msg=Question+deleted+successfully"); exit(); ?>
💾 Kaydet
İptal