Passing user Input from a HTML page to a Perl script and displaying the results in webpage
<p>I have the existing setup as below.</p>

<h1>Existing Setup:</h1>

<p>Below is the user interactive perl script which takes the EmpNo as argument and prints the Name and Salary of the employee from the  Employee table.
Currently I am running this script in terminal and output is also shown on the terminal.</p>

<h1>Perl Code</h1>

<pre><code>#!/usr/bin/perl

use DBI;
use strict;

my $driver = "mysql";
my $database = "dbname";
my $dsn = "DBI:$driver:database=$database";
my $userid = "uid";

print "Enter employee Number \n";

my $input1 =&lt;&gt;;


my $dbh = DBI-&gt;connect($dsn, $userid) or die $DBI::errstr;

my $sth = $dbh-&gt;prepare("SELECT Empname ,Salary FROM Employee WHERE EmpNo ='$input1' ");

$sth-&gt;execute() or die $DBI::errstr;
print "Number of rows found :" + $sth-&gt;rows;
while (my @row = $sth-&gt;fetchrow_array()) {
   my ($name, $salary) = @row;
   print "Name = $name, Salary = $salary \n";
}
$sth-&gt;finish()
</code></pre>

<h1>Output: perl test.pl</h1>

<p>Enter employee Number
207711
Name=John Salary=10000</p>

<h1>Requirement:</h1>

<p>Instead on running the script on terminal with user Input . I like to have a HTML web page where user can select the EmpNo from the drop down list and this EmpNo should be passed to the Perl script  on clicking the submit
button. The script then should fetch the database details and show on webpage. </p>

<h1>Brief Idea:</h1>

<p>Something like this with forms.</p>

<pre><code>&lt;FORM action="/test.pl" method="POST"&gt;

&lt; select name = "Employee details" &gt;
    &lt;option selected = "selected"&gt;EmpNo&lt;/option&gt;
    &lt;option value = "207711"&gt;207711&lt;/option&gt;
    &lt;option value = "207712"&gt;207712&lt;/option&gt;
    &lt;option value = "207713"&gt;207713&lt;/option&gt;
&lt;/select&gt;

&lt;input type="submit" value="Submit"&gt;

&lt;/FORM&gt;
</code></pre>

<p>I am open to use CGI and have Apache installed. Awaiting your valuable response. Thanks a lot !!!</p>