What Is the Purpose of Hidden Fields in Perl CGI?

Perl CGI forms can take information entered into an HTML form and process it, creating interactive results or storing data across multiple browsing sessions. The CGI form takes data by getting values passed by an HTML, defined by value name identifications. This makes creating certain pages that connect to a Perl server, such as shopping carts or registration pages, easy. Within Perl CGI scripts, the programmer can embed hidden fields, which can aid in information processing.

  1. Perl CGI

    • Perl CGI scripts serve a basic function of connecting users to websites by processing user input in a Perl environment. When a user enters any information into an HTML form, it must be processed in some way. This can be done through JavaScript or PHP directly in the document; but Perl programmers would create a Perl CGI script, which runs on a server software platform such as Apache with Perl interpreting capabilities. The Perl CGI script will receive information passed to it by HTML fields.

    HTML Forms and Fields

    • In an HTML document, the programmer will get user input through "form" and "field" tags. These tags designate what a form will do when a user submits information, and how the user is allowed to enter information. So, for example, an input form named "register" might take a username and password from two input fields, and process the information through a Perl CGI once a submission button field is pressed.

    Hidden Fields

    • In Perl CGI, however, the programmer can create a field that remains hidden from view. For example, a Perl CGI script can create a hidden field in a document does not appear in the browser window. Not that the field is entirely hidden: users who check the source of the document in the browser will see the hidden field in the HTML code. Hidden fields were not intended for security, however. Rather, the hidden fields pass information not intended to be changed.

    Passing Information

    • Much like visible fields pass information entered by the user, hidden fields pass information along with the user-entered input that is not to be manipulated by the user. This information might pertain to the state of the session, or might be used to name a file created by the user. In any case, the programmer wishes to send the information along with the rest of the information in the form. This way, all the information is passed in the same way, and can be parsed easier by the Perl CGI script.

Related Searches:

References

Comments

Related Ads

Featured