Logo PERL

Contact     Flash     JavaScript     Perl     Bit Maps     Vector Images     Websites


Get1     Get2     Post     Email1     Email2     LogFile

This is the Perl section of my portfolio. There are several examples of Perl script on this page. Click on the links above to be taken to each Perl script. Click the "Top" button to return to the top of the page.

Security on the Internet is a very important issue. The security of the information that a user may be transmitting is crucial to ensure user trust in a Website. The use of Perl scripts is one way of ensuring that user information is protected.

The first Perl script example is a form submission using Get. In this example the data itself is not manipulated, but is echoed back to the browser and written in an HTML document. After the script is written an HTML document is created that contains forms elements and the submit button. The HTML document activates the CGI script when the form fields are filled in and the user clicks the submit button. To view the Perl script click on the button below. JavaScript must be enabled in order for this feature to work.

Top

The next Perl script example is also a form submission using Get. This script will break the string into an array, using the "&" character. Then each name/value pair are split into two separate values. Each pair is sent back to the client in an HTML document. To view the Perl script click on the button below. JavaScript must be enabled in order for this feature to work.

Top

My next Perl script example is a form submission using Post. This script checks to ensure the URL from which the form was sent against the "$goodURL" to ensure that the form data is coming from the correct place. Then reads the form data submitted using Post. If the form data submitted does not come from the correct URL a message is sent back to the user and the data is not submitted. If the form data is submitted from the correct URL the text is formatted and a message is sent back to the user saying the form has been submitted. To view the Perl script click on the button below. JavaScript must be enabled in order for this feature to work.

Top

A more "real world" Perl script example is an form submission using Post, the form data is formatted and emailed to an address directly from the server. A confirmation email is sent back to the user using the email address entered. Two additional functions that have been added to this script is the conversion of special characters and finding and removing server-side includes. The following script will check to ensure that the form data is coming from the "$goodURL". If the form data submitted does not come from the correct URL a message is sent back to the user and the data is not submitted. If the form data submitted is from the correct URL the form data is parsed. The server creates and sends an email and a confirmation email is sent back to the user. The server also provides a response back to the user that the form data has been submitted. To view the Perl script click on the button below. JavaScript must be enabled in order for this feature to work.

Top

Another "real world" Perl script example would be that in the HTML document the user has the option to select from a series of options to submit an order, ask a question or find out about jobs in the company. In the HTML document the user can check an option. When the user clicks the "Submit" button the form data is sent to a particular email address contained in the Perl script. As in the above example the script will ensure that the form data is being submitted from the "$goodURL". If the form data submitted does not come from the correct URL a message is sent back to the user and the data is not submitted. If the form data submitted is from the correct URL the form data is parsed. The server creates and sends an email based on the option that the user has chosen and a confirmation email is sent back to the user. The server also provides a response back to the user that the form data has been submitted. To view the Perl script click on the button below. JavaScript must be enabled in order for this feature to work.

Top

The last Perl script example is a text file that saves the IP addresses of all visitors. A blank text document is created to record the log contents. The HTML document contains an SSI (server-side include) which activates the CGI script when the page loads. The CGI files contains the Perl script that performs the log function. There is a log file that records the IP addresses of all visitors on this website. To view the Perl script click on the button below. JavaScript must be enabled in order for this feature to work.

Top