James Jones James Jones - 1 month ago 11
HTML Question

Before server side scripting how were HTML forms interpreted

In the modern web an HTML

<form>
element is submitted and then interpreted by scripting. Either it is interpreted by a server side programming language (usually PHP) or it is interpreted by a client side script (almost always JavaScript).

But in the early 90s there was no scripting, it was just good ol' HTML. Forms existed then. How were forms interpreted back then?

According to https://en.wikipedia.org/wiki/Form_(HTML)#cite_note-5 there was an email based HTML form submission back then, but it was unreliable. Was this all there was? Why did HTML even have forms if they were so useless without scripting. Or was it a chicken and egg sort of situation?

Answer

Before server side scripting (PHP, Ruby, node.js) there was server side programming.

One of the original interfaces between web servers and back-end processes was the Common Gateway Interface (CGI). It was introduced in the early 90s by the NCSA back-end team at the same time forms was introduced into HTML by Tim Berners-Lee (who was also at NCSA at the time). So forms was introduced at roughly the same time CGI was invented.

Initially a lot of people wrote CGI programs in C. I was one of those who had to do so as a homework assignment. Instead of a giant all-encompassing framework we wrote small C programs that read from stdin and print to stdout (we printed HTTP response, not just the HTML as per CGI spec). A website had lots of these small programs each doing one small thing and updated some database (sometimes that database was just a flat file).

Almost as soon as it was introduced people also started writing CGI scripts in Perl. So there was really no transition period between C programs and scripting languages. People simply stopped writing CGI scripts in C because it was faster to do so in scripting languages.