-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcdeinputexample.php
More file actions
37 lines (29 loc) · 986 Bytes
/
cdeinputexample.php
File metadata and controls
37 lines (29 loc) · 986 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
<html>
<body>
<form method="post">
<?php
//Example for $CDE->switchid
require_once ("cdesimple.php");
$CDE = new CDESimple ("database.db", "", "", "sqlite3");
echo $CDE->switchid("switchid");
//Actual switch in code, assuming we are posting to same place
switch ($_REQUEST["switchid"]) {
//what to do when switch is 100
case 100:
echo "Ok we're done! ".$_REQUEST["edtName"]." your choice was Option ".$_REQUEST["edtChoose"];
break;
case 200:
echo "Type in some values:<br>";
echo "Name:".$CDE->input ("edtName", 200 )."<br>";
echo "Choice:".$CDE->select ($name="edtChoose", $width=100, $alttext="Choose something", $selecttype="array", $lookup="1,Apples|2,Bananas");
echo $CDE->input ("btnGo", 100, "Click here to see what happens", $compulsory="", "button", "Go", "onclick=\"setswitchid(100);\"")."<br>";
break;
default:
echo "Hello";
setswitchid (200, true); // true means post will be called
break;
}
?>
</form>
</body>
</html>