How does JPEG format work?
The JPEG compression process consists of several steps. In the first step, the image is converted from the RGB color space to the YUV space, based on the brightness and…

Continue reading →

How to make a menu for a site? The main features of the menu selection
Whatever the site, without which it certainly cannot do, is without a menu. And often on one site there are several menus at once - for the main and additional…

Continue reading →

The difference between UI and UX
Today there will be a guest post on the topic of UX and UI interfaces using the Icons8 service as an example. The author is a usability specialist Andrei Burmistrov,…

Continue reading →

Interactivity! What? And How?

Initially, there was a network, then e-mail appeared, and people began to correspond. They wanted to tell about themselves, share information – the World Wide Web (WWW) appeared. But static pages are just static pages … and then interactivity appeared!

First, let’s define the terminology. By interactive pages, I mean those that implement an interface with some program running on the server side. The form on the web page receives some data from the user, and the browser passes it to the web server, which launches the desired program. After the request has completed, the program returns the result to the web server, and it forms an HTML page on the fly and sends it back to the browser.

So what can we do using interactivity? The most famous thing that comes to mind is counters, guest books, forwarders, online stores, and database interfaces. In practice, anything can be done. It all depends on the skill of the programmer.

How is this done technically? And here’s how – on the server side, we place the necessary programs, databases, .. and configure the web server so that it can transfer user requests from the network to the processing program and get the result from it. This is done through the CGI protocol – Common Gateway Interface (which in Russian sounds like a “common gateway interface”). CGI is a set of rules by which a server passes a request to a program. Any program written in such a way as to satisfy these requirements can be used on a Web server.

The programming language in which the program is written does not matter much, and anyone can be used. The most popular programming language used to write simple programs is PERL, a language originally developed for writing reports and ideally suited for simple CGI programs. PERL language text is usually called a script (not to be confused with JavaScript – the PERL program runs on the server side, while JavaScript on the client side). The language is interpretive, that is, analyzing the text of the program during execution. For PERL to work on the web server, the appropriate interpreter must be installed and configured correctly.

Thus, interactive pages can be divided into two parts: form and program. In the form, we need to correctly describe all the elements of the interface and indicate the path to the program being executed. As you can see, everything is not so complicated. But what if you are not a programmer, but you need a simple program? In this case, you can use the archive of ready-made scripts, most of which are free. All typical tasks have long been resolved and debugged. These are guest books, counters, mailing lists, etc. You just need to find the right one and carefully read the description for it. After that, it remains only to correctly place the elements in the form and specify specific parameters for this script. More complex programs already have to be written by programmers with sufficient experience to do this.

Email form
Let’s look at a typical example – sending a form by mail. To do this, we will use the ready-made program from the Matt Wright archive, designed to send the contents of the form by mail – FormMail. This script needs to be configured and placed on the web server in a special directory where the CGI programs are located. Usually it is called cgi-bin (for confidence, consult with your provider – does it provide services for hosting CGI scripts, and what is the name of the directory for hosting scripts). And on the page – describe the form. Thus, we need to prepare two files: create an HTML form and configure a Perl script for our needs.

Form creation
Let’s start with the form. The description of the form will be between the <form> and </form> tags and contain the form elements inside. We will make the most minimalist version of the form sender, which will contain the following fields: name, email address, message text. The HTML code of our page is as follows:

<html>
<head> <title> Email form </title> </head>
<body>

<form name = “Request” action = “/ cgi-bin / formmail.pl” method = “post”>
<input type = hidden name = “recipient” value = “yourmail@domain.com”>
<input type = hidden name = “subject” value = “Request for information”>
Your Name: <br>
<input type = text name = “Name”> <br>
Email: <br>
<input type = text name = “E-mail”> <br>
Message: <br>
<textarea name = “Message”> </textarea> <br> <br>
<input type = submit value = “Send”>
<input type = reset value = “Clear”>
</form>

</body>
</html>
A bit of clarification on the above code. Pay attention to the action parameter in the <form> tag – it defines the address of our script (.pl is the standard extension for programs written in PERL). The first elements in the form are special hidden fields for transmitting information to the script: the recipient field defines the e-mail to which we want to send the contents of the form.

Web design and font size selection for the site
Too small font of the main text used on the site can become one of the factors of pessimization of this site in search results, because today search engines pay…

...

What are longreads on sites
The so-called longreads are one of the leading web design trends in 2015, and also, as expected, in 2016. With the help of long reads, sites today do not just…

...

The main types of user interface buttons
Buttons are one of the most famous interactive user interface elements. They play a very important role in creating user interaction and creating a positive experience. Continuing a series of…

...

GIF Image Optimization
Converting a full-color image to an index image (i.e. using a palette) is an important operation, and here a few words need to be said about how this is done…

...