Skip to content

Instantly share code, notes, and snippets.

@Colk-tech
Created July 1, 2022 05:40
Show Gist options
  • Save Colk-tech/271b63b5b87172421193d091f31093c3 to your computer and use it in GitHub Desktop.
Save Colk-tech/271b63b5b87172421193d091f31093c3 to your computer and use it in GitHub Desktop.
CGI Samples
#!/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
#!/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>"
#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