It is possible to write an HTML form in C or C ++

I use PHP, and I know that PHP is written in C or uses C in some way. I am trying to understand lower level languages. So can someone explain to me how the HTML that PHP generates (say markup for the form) is built with C. Can I create a web form in C or C ++ and how?

+4
source share
4 answers

You can write the Common Gateway Interface program (otherwise called CGI) in any computer language that can send text to a standard output channel (i.e., almost every one):

#include <stdlib.h> #include <stdio.h> int main(int argc, char *argv[]) { printf("Content-type: text/html\n\n"); printf("<pre>Hello, World!</pre>\n"); return EXIT_SUCCESS; } 

[html, body, etc. tags omitted for brevity].

+7
source

Exactly the same as in PHP.

Strictly speaking, an "HTML form" (like any other HTML code) is just a block of text.
And C prints texts well, as well as any other lagoons.

+7
source

Yes, of course, you can do html using C ++, in addition, there are some frameworks available for web development using C ++ http://www.webtoolkit.eu/wt

+2
source

Just as you create them in PHP. You echo (or in the C case printf() ) the elements on the server side, and this should be analyzed by the web server and served to the client.

+2
source

Source: https://habr.com/ru/post/1382166/


All Articles