index.php hinzugefügt
This commit is contained in:
commit
6503092391
46
index.php
Normal file
46
index.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
// Fehleranzeige nur für Demo-Zwecke aktivieren
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
// Beispiel: einfache Formularverarbeitung
|
||||
$name = "";
|
||||
if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
$name = htmlspecialchars($_POST["name"] ?? "");
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>PHP Demo</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; margin: 40px; }
|
||||
.box { padding: 20px; border: 1px solid #ccc; border-radius: 8px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="box">
|
||||
<h1>PHP funktioniert ✅</h1>
|
||||
|
||||
<p><strong>Serverzeit:</strong> <?= date("d.m.Y H:i:s") ?></p>
|
||||
<p><strong>PHP-Version:</strong> <?= phpversion() ?></p>
|
||||
<p><strong>Client-IP:</strong> <?= $_SERVER["REMOTE_ADDR"] ?></p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2>Formular-Test</h2>
|
||||
<form method="post">
|
||||
<input type="text" name="name" placeholder="Dein Name">
|
||||
<button type="submit">Absenden</button>
|
||||
</form>
|
||||
|
||||
<?php if ($name): ?>
|
||||
<p>Hallo <strong><?= $name ?></strong> 👋</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user