-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_flashcard.php
37 lines (33 loc) · 1.28 KB
/
create_flashcard.php
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
<?php
// Database connection
include 'db_connection.php';
// Validate access code
$access_code = $_GET['access_code'];
$table_name = mysqli_real_escape_string($conn, $access_code);
$check_table_query = "SHOW TABLES LIKE '$table_name'";
$result = $conn->query($check_table_query);
if ($result->num_rows != 1) {
header("Location: login.php");
exit;
}
// Header
$page_title = "ایجاد فلش کارت";
include 'header.php';
?>
<form action="create_flashcard_process.php" method="POST" <?php if ($access_code === 'test') echo 'onsubmit="return false;"'; ?>>
<input type="hidden" name="access_code" value="<?php echo $access_code; ?>">
<label for="content">کلمه</label>
<input type="text" id="content" name="content" required>
<label for="hint">یادداشت</label>
<textarea type="text" id="hint" name="hint"></textarea>
<label for="status">سطح</label>
<select id="status" name="status" required>
<option value="0">آسان</option>
<option value="1">متوسط</option>
<option value="2">دشوار</option>
</select>
<input type="submit" value="ایجاد فلش کارت" name="create_flashcard" class="button <?php if ($access_code === 'test') echo "limited"; ?>">
</form>
<!-- Footer -->
</div>
<?php include 'footer.php'; ?>