-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoin.php
More file actions
40 lines (31 loc) · 920 Bytes
/
Copy pathjoin.php
File metadata and controls
40 lines (31 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$room = $_GET['room'] ?? '';
if (!$room) {
die("Room code missing.");
}
$path = "rooms/$room.json";
if (!file_exists($path)) {
die("Room not found.");
}
$data = json_decode(file_get_contents($path), true);
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Join Game - <?= htmlspecialchars($room) ?></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>🎮 Join Game</h2>
<p>Room Code: <strong><?= htmlspecialchars($room) ?></strong></p>
<form action="lobby.php" method="POST">
<input type="hidden" name="room" value="<?= htmlspecialchars($room) ?>">
<input type="text" name="name" placeholder="Enter your name" required>
<button type="submit">Join Room</button>
</form>
<p><a href="index.php">⬅️ Back to Start</a></p>
</body>
</html>