109

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).

Forms existed even in the early 90s. How were they interpreted back then?

According to this Wikipedia article 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?

4
  • 25
    i used perl with cgi
    – user6763587
    Oct 27, 2016 at 4:20
  • 67
    There was always server-side scripting
    – OrangeDog
    Oct 27, 2016 at 8:43
  • 22
    To complete the picture, some early forms used action="mailto:[email protected]" which told a web browser to start an e-mail client and transfer the submitted fields as the crude contents of a new e-mail. Zero programming, just some staff to process the e-mails by hand.
    – kubanczyk
    Oct 27, 2016 at 9:05
  • 2
    Before forms, even, there was <ISINDEX>, which was often plugged into a WAIS server.
    – zwol
    Oct 27, 2016 at 15:46

4 Answers 4

184

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.

10
  • 4
    Great answer from both you and @Dekel. These answers and the suggested links really fill in the gap. I can't help but wonder how many websites actually bothered implementing any of this stuff before techs like JS, Perl, PHP were available for web scripting. But that's a question for another day. Oct 27, 2016 at 4:03
  • 15
    @JamesJones, lots and lots of us did. It wasn't all that hard to get started, although the tools to scale up to large and high-performing web apps were lacking. I read CGI Programming on the World Wide Web in the late '90s and started writing all kinds of CGI code as a teenager.
    – Dan Lenski
    Oct 27, 2016 at 6:24
  • 12
    Actually, a basic CGI program is very easy to write. Just print out some static headers, and some HTML with your data interspersed. It's just that the technology (HTML mixed with headers mixed with code...) does not scale well to complex applications. Hence frameworks were invented...
    – sleske
    Oct 27, 2016 at 7:25
  • 12
    If you still want to see CGI in action, try the Swiss railway timetable: sbb.ch - enter a departure and destination location - press the red button - then take a look at the URL in the browser, especially the query.exe part :-)
    – theDmi
    Oct 27, 2016 at 8:15
  • 8
    In re "how widespread was it": well, far more websites were completely static back then. But the two commonly-seen bits of active content were "guestbooks" (obsoleted by blogs/social media/spam) and "hit counters".
    – pjc50
    Oct 27, 2016 at 10:25
70

Server side was actually always in the picture.

The Apache HTTP Server was available since 1995, and in 1996 it also had Perl support (which was used as a server-side programming language).

JavaScript was created in 1996 and Netscape was the first browser supported the client-side language (other browsers vendors implementations were based on the work that was done in Netscape).

In 1993 the Mosaic browser is released with support for images, nested lists and fill-out forms.

Basically - every HTTP server that could handle request and pass it to some application (no matter in what language that application is written in) is a server-side application. It can be written in scripting language (Perl/Python/PHP/Ruby), high-level language (Java/C#) and if you really want - even assembly. All you need to do is make sure you "follow the protocol".

6
  • 1
    Good history. Upvoted. However, forms were implemented before 1995. I can't work out just when, but in en.wikipedia.org/wiki/HTML there is Dave Raggett's competing Internet-Draft, "HTML+ (Hypertext Markup Format)", from late 1993, suggested standardizing already-implemented features like tables and fill-out forms. Is your last paragraph describing practices before 1995? Oct 27, 2016 at 3:36
  • 3
    @JamesJones: Check wikipedia entry on Common Gateway Interface
    – slebetman
    Oct 27, 2016 at 3:41
  • 2
    @JamesJones, added some info regarding the Mosaic Browser and fill-out forms. You also have a great answer by slebetman regarding CGI.
    – Dekel
    Oct 27, 2016 at 3:42
  • 1
    @JamesJones Standards aren't clear-cut, and it applies in full to most things around the web (though not internet as a whole). The HTML standard was (and really, still is) horrible, and everyone created their own extensions. Mosaic, Netscape and Internet Explorer were the most notorious - most of their extensions were added to later HTML standards, with Netscape and IE coöperating quite a bit on that. HTML didn't even have embedded images (img) back then - the author considered it unfitting to the idea of hyper-text; only the success of Mosaic/Netscape forced the change in the standard.
    – Luaan
    Oct 27, 2016 at 10:54
  • 3
    This answer isn't necessarily wrong, but I'm not quite sure how things introduced at least 2-3 years after forms were available in the browser is evidence that there has always been server-side support for forms.
    – 8bittree
    Oct 27, 2016 at 15:59
1

JavaScript wasn't so advance (hell Ajax wasn't even out yet). So it was pure server-side. Mostly CGI (being Perl) and PHP.

There was also Coldfusion but wasn't a popular favorite.

Eventually, at the end of 1999 and early 2000s ASP.NET (aspx) and JavaServer Pages (jsp) came out, although a lot of commercial sites used aspx and jsp for obvious reasons.

Note, Java applets also existed (mostly for rendering though) but had to be separately downloaded and supported by the browser.

2
  • 3
    Actually, I did program ASPs by the beginning of 1998. Before that, there was another MS standard called htx templates. Nov 1, 2016 at 20:55
  • Before asp.net, there were plain old active server pages - ASP. If you’re in a hurry and just need to throw something together, they’re pretty rad. Well, I guess it’s about the same as PHP… I just have a soft spot for ASP, because I fell in love with them during my internship. You write VBScript for server-side, intermingle HTML and JavaScript for the client-side, and it’s all in the same .asp file. No project necessary. No compile necessary. If a web server understands asp, you throw it out there and it’s ready to be used. ASP - ‘96. ASP.Net - ‘02
    – PopeDarren
    Feb 2, 2022 at 4:34
1

Additionally, I stumbled on an interesting piece of history on Wikipedia. HTML forms could also be sent by e-mail, using a mailto: address in the target attribute. Didn't seem to be popular, but still cool!

Quoting the Wikipedia article:

User-agent support for email based HTML form submission, using a 'mailto' URL as the form action, was proposed in RFC 1867 section 5.6, during the HTML 3.2 era. Various web browsers implemented it by invoking a separate email program or using their own rudimentary SMTP capabilities. Although sometimes unreliable, it was briefly popular as a simple way to transmit form data without involving a web server or CGI scripts.

And RFC 1867 (November 1995):

5.6 Allow form ACTION to be "mailto:"

Independent of this proposal, it would be very useful for HTML
interpreting user agents to allow a ACTION in a form to be a
"mailto:" URL. This seems like a good idea, with or without this
proposal. Similarly, the ACTION for a HTML form which is received via mail should probably default to the "reply-to:" of the message.
These two proposals would allow HTML forms to be served via HTTP
servers but sent back via mail, or, alternatively, allow HTML forms
to be sent by mail, filled out by HTML-aware mail recipients, and the results mailed back.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.