📲 Download Utility Tools Apps

EMI Calculator

Download EMI Calculator

SOA Games

Download SOA Games

SOA Technology App

Download SOA Technology

BMI Checker

Download BMI Checker

Task Jira

Download Task Jira

Laughing Adda

Download Laughing Adda

📅 हिंदी कैलेंडर ऐप डाउनलोड करें

Download Shubhcalendar App

Online Quiz System (PHP + JS ready project)

I’ve created a ready-to-use Online Quiz System (PHP + JS) for you in the canvas.

🚀 What this project includes:

  • Session-based quiz system
  • Multiple questions with options
  • Auto score calculation
  • Timer (auto-submit)
  • Clean UI (basic styling)

💡 How to use:

  1. Save file as: quiz.php
  2. Run on localhost (XAMPP/WAMP)
  3. Open in browser: http://localhost/quiz.php
<?php
// ===== SIMPLE ONLINE QUIZ SYSTEM (PHP + JS) =====
session_start();

$questions = [
    [
        "question" => "What does PHP stand for?",
        "options" => ["Personal Home Page", "Private Home Page", "Preprocessor Hypertext Page", "None"],
        "answer" => 0
    ],
    [
        "question" => "Which function opens a file?",
        "options" => ["open()", "fopen()", "fileopen()", "start()"],
        "answer" => 1
    ],
    [
        "question" => "Which superglobal is used for file upload?",
        "options" => ["$_POST", "$_GET", "$_FILES", "$_DATA"],
        "answer" => 2
    ]
];

if (!isset($_SESSION['index'])) {
    $_SESSION['index'] = 0;
    $_SESSION['score'] = 0;
}

if (isset($_POST['answer'])) {
    $current = $_SESSION['index'];
    if ($_POST['answer'] == $questions[$current]['answer']) {
        $_SESSION['score']++;
    }
    $_SESSION['index']++;
}

if ($_SESSION['index'] >= count($questions)) {
    echo "<h2>Quiz Finished!</h2>";
    echo "<p>Your Score: " . $_SESSION['score'] . " / " . count($questions) . "</p>";
    session_destroy();
    exit;
}

$current = $_SESSION['index'];
$q = $questions[$current];
?>

<!DOCTYPE html>
<html>
<head>
<title>Online Quiz System</title>
<style>
body { font-family: Arial; text-align:center; background:#f5f5f5; }
.quiz-box { background:#fff; padding:20px; margin:50px auto; width:400px; border-radius:10px; }
button { display:block; margin:10px auto; padding:10px; width:80%; }
</style>
</head>
<body>

<div class="quiz-box">
<h3>Question <?php echo $current+1; ?></h3>
<p><?php echo $q['question']; ?></p>

<form method="post" id="quizForm">
<?php foreach($q['options'] as $key => $option): ?>
    <button type="submit" name="answer" value="<?php echo $key; ?>">
        <?php echo $option; ?>
    </button>
<?php endforeach; ?>
</form>
</div>

<script>
// Simple timer
let time = 10;
let timer = setInterval(() => {
    document.title = "Time Left: " + time;
    time--;
    if(time < 0) {
        clearInterval(timer);
        document.getElementById('quizForm').submit();
    }
}, 1000);
</script>

</body>
</html>


AI Spiritual Tools & Interactive Experiences

Explore powerful AI-driven tools for daily guidance, spirituality, fun quizzes, and self-discovery.

Today’s Quote

Get inspiring daily quotes powered by AI to motivate and guide your day.

Explore Now

AI Tarot Card Reader

Reveal insights about your future, love, and career with AI tarot readings.

Read Tarot

Love Match Calculator

Check compatibility and love predictions using AI-based analysis.

Check Match

Fortune Cookie

Open an AI fortune cookie and receive wisdom, luck, and fun messages.

Open Cookie

Quiz Categories

Engage with knowledge-based and fun quizzes across multiple categories.

Start Quiz

Panchang Calendar

View daily Panchang, auspicious timings, tithi, nakshatra, and festivals.

View Panchang

Online Numerology

Discover your destiny number, life path, and numerology predictions.

Calculate Now

Spiritual Feeds

Stay connected with spiritual thoughts, mantras, and divine content.

View Feeds

Quiz Hub

Attempt trending quizzes on GK, spirituality, festivals, and more.

Explore Quizzes