aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile (renamed from examples/makefile)7
-rw-r--r--examples/append.c4
-rw-r--r--examples/upload.c6
3 files changed, 11 insertions, 6 deletions
diff --git a/examples/makefile b/examples/Makefile
index e3205aa..d93176b 100644
--- a/examples/makefile
+++ b/examples/Makefile
@@ -14,10 +14,15 @@ endif
INCLUDE = -I ../src
LFLAGS = -L.. -lmagi
+MAGI = ../libmagi.a
+
default: $(EXAMPLES)
-%: %.c
+$(MAGI):
+ cd ..; $(MAKE)
+
+%: %.c $(MAGI)
$(CC) $(CFLAGS) $(INCLUDE) $< $(LFLAGS) -o $@
clean:
diff --git a/examples/append.c b/examples/append.c
index f0dfe2a..65caa33 100644
--- a/examples/append.c
+++ b/examples/append.c
@@ -30,10 +30,10 @@ void print_webpage()
"<html xmlns='http://www.w3.org/1999/xhtml'>"
"<head><title>Append to File</title></head>"
"<body>"
- "<form action='/cgi-bin/append' method='GET'>"
+ "<form action='/cgi-bin/append' method='get'><fieldset>"
"<input type='text' name='addon' value='Whatever you want to add.'/>"
"<input type='submit' value='Append'/>"
- "</form>"
+ "</fieldset></form>"
"</body>"
"</html>"
);
diff --git a/examples/upload.c b/examples/upload.c
index 9dc1efd..1dc9659 100644
--- a/examples/upload.c
+++ b/examples/upload.c
@@ -53,12 +53,12 @@ void print_webpage()
"<html xmlns='http://www.w3.org/1999/xhtml'>"
"<head><title>Upload File</title></head>"
"<body>"
- "<form action='/cgi-bin/upload' method='POST' "
- "enctype='multipart/form-data'>"
+ "<form action='/cgi-bin/upload' method='post' "
+ "enctype='multipart/form-data'><fieldset>"
"<input type='text' name='name' value='filename'/>"
"<input type='file' name='data'/>"
"<input type='submit' value='Upload'/>"
- "</form>"
+ "</fieldset></form>"
"</body>"
"</html>"
);