Created
July 1, 2022 05:40
-
-
Save Colk-tech/271b63b5b87172421193d091f31093c3 to your computer and use it in GitHub Desktop.
CGI Samples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
$title = "Hello!"; | |
$body = "Hello, World from Perl.¥n"; print << "EOT"; | |
Content-Type: text/html | |
<html> <head><title>$title</title></head> <body> | |
$body | |
</body> | |
</html> | |
EOT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
title = "Hello!" | |
body = "Hello, World from Python" print "Content-Type: text/html" | |
print "" | |
print "<html>" | |
print "<head><title>", title, "</title></head>" | |
print "<body>", body, "</body></html>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) { | |
char title[] = "Hello!"; | |
char body[] = "Hello, World from C."; printf("Content-Type: text/html¥n"); printf("¥n"); | |
printf("<html>¥n"); printf(“<head><title>%s</title>¥n", title); printf("</head>¥n"); | |
printf("<body>¥n"); | |
printf("%s¥n", body); | |
printf("</body>¥n"); | |
printf("</html>¥n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment