aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-09-17 17:02:29 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-09-17 17:03:57 +0200
commit2810ad72aeb973a898034d6875922284062c5ce0 (patch)
tree2c7555b79054d57350cc4136e3215094c9b4b685 /t
parent38f8e2242353711d5c87c58f3831306934d2e6b7 (diff)
downloadcforum-2810ad72aeb973a898034d6875922284062c5ce0.tar.gz
Rework query functions
Now, the value/parameter retrieval function handles both GET and POST parameters.
Diffstat (limited to 't')
-rw-r--r--t/front.t16
-rw-r--r--t/front.tc14
2 files changed, 28 insertions, 2 deletions
diff --git a/t/front.t b/t/front.t
index ed6fbf8..0a372a6 100644
--- a/t/front.t
+++ b/t/front.t
@@ -1,2 +1,16 @@
<h1><%= site.name %></h1>
-<% printf("Hello world!"); %> \ No newline at end of file
+<% printf("Hello world!"); %>
+<br>
+Request method: <%= getenv("REQUEST_METHOD") %>
+<br>
+<%
+ char *a, *b, *bv;
+ a = nextparam(512);
+ printf("%s (%d)<br>", a, TRUNCATED(a));
+ b = nextparam(512);
+ printf("%s (%d)<br>", b, TRUNCATED(b));
+ bv = split(b);
+ printf("'%s' contains '%s'<br>", b, bv);
+ printf("Next: %s\n", nextparam(512));
+ printf("Next: %s\n", nextparam(512));
+%> \ No newline at end of file
diff --git a/t/front.tc b/t/front.tc
index 0d7aec3..89e665a 100644
--- a/t/front.tc
+++ b/t/front.tc
@@ -1,4 +1,16 @@
printf("<h1>");
printf("%s", site.name );
printf("</h1>\n");
- printf("Hello world!"); printf("\n");
+ printf("Hello world!"); printf("\n<br>\nRequest method: ");
+printf("%s", getenv("REQUEST_METHOD") );
+printf("<br>\n");
+ char *a, *b, *bv;
+ a = nextparam(512);
+ printf("%s (%d)<br>", a, TRUNCATED(a));
+ b = nextparam(512);
+ printf("%s (%d)<br>", b, TRUNCATED(b));
+ bv = split(b);
+ printf("'%s' contains '%s'<br>", b, bv);
+ printf("Next: %s\n", nextparam(512));
+ printf("Next: %s\n", nextparam(512));
+printf("\n");