Cgi koodinäiteid: erinevus redaktsioonide vahel
Mine navigeerimisribale
Mine otsikasti
Resümee puudub |
Resümee puudub |
||
| 21. rida: | 21. rida: | ||
foo() | foo() | ||
foo() | foo() | ||
</pre> | |||
C "hello world" programm, mis tuleks kompileerida. | |||
<pre> | |||
#include <stdio.h> | |||
int main(void) { | |||
printf("content-type: text/html\n\n"); | |||
printf("Tere ise ka!\n"); | |||
/* | |||
fflush(stdout); | |||
exit(0); | |||
*/ | |||
} | |||
</pre> | </pre> | ||
Redaktsioon: 8. märts 2006, kell 10:23
Shelli skript, mis kuvab kataloogi listingu:
#!/bin/sh echo 'content-type: text/html' echo echo ' uus ok leht olemas ' ls -l
Pythoni skript, mis trükib ühe sõna kolm korda:
#!/usr/bin/python def foo(): print "<p>miskijutt</p>" print "content-type: text/html" print print "ok !! jalle olemas" foo() foo() foo()
C "hello world" programm, mis tuleks kompileerida.
#include <stdio.h>
int main(void) {
printf("content-type: text/html\n\n");
printf("Tere ise ka!\n");
/*
fflush(stdout);
exit(0);
*/
}