forked from aaronbronow/php-crossword
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdemo-add-words.php
57 lines (50 loc) · 1.05 KB
/
demo-add-words.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head>
<style>
body, td { font-family: Courier; font-size: 10pt; }
.crossTable { border-spacing:0px; border-collapse: collapse; }
.cellEmpty { padding: 0px; }
.cellLetter { padding: 2px; background-color: #EEEEEE; border: 1px solid #000000; width: 20px; height: 20px; }
</style>
</head>
<body>
<?php
require 'init.php';
$groupid = 'demo';
$pc->setGroupID($groupid);
switch ($_REQUEST['act'])
{
case 'add_single':
$pc->insertWord($_REQUEST['word'], $_REQUEST['question']);
break;
}
?>
<table align="center">
<tr>
<td>Group ID:</td>
<td><b><?=$pc->groupid?></b></td>
</tr>
<tr>
<td>Words in group:</td>
<td><b><?=$pc->countWordsInGroup()?></b></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<form action="?act=add_single" method="post">
<tr>
<td>Word:</td>
<td><input type="text" name="word" /></td>
</tr>
<tr>
<td>Question:</td>
<td><input type="text" name="question" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Add one word" /></td>
</tr>
</form>
</table>
</body>
</html>