title: How to insert the form arrays from URL to DBD database using perl script?
body: <p>I am trying to get the data filled in the html to DBD database using perl script.</p>
  
  <p>Here is my html code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;/head&gt;
  
  
  &lt;body&gt;
  &lt;H1&gt;Friend's contact book&lt;/H1&gt;
  
  &lt;FORM ACTION="contact.pl" METHOD="POST"&gt;
  
  
  &lt;HR&gt;
  &lt;H2&gt;Friend's contact&lt;/H2&gt;
  
  &lt;PRE&gt;
            Name:&lt;INPUT TYPE="text" NAME="name"&gt; 
           Address:&lt;INPUT TYPE="text" NAME="add"&gt; 
  
  
  &lt;/PRE&gt;
  
  &lt;/HR&gt;&lt;P&gt;
  &lt;INPUT TYPE="submit" VALUE="Sign Up"&gt; or &lt;INPUT TYPE="reset" VALUE="Cancel"&gt;
  &lt;/P&gt;
  &lt;/FORM&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Here is my perl script:
  contact.pl</p>
  
  <pre><code>#!/usr/bin/perl
  
  # Initialize DBI.
  use DBI;
  use strict;
  
  # Make the database connection.
  my $dbh = DBI-&gt;connect("dbi:Pg:dbname=friendcontact") 
  or die my $DBI::errstr;
  
     # Store the SQL query
  
  myy $stat = my $dbh-&gt;prepare("INSERT into friend (name, add) VALUE 
  (?,?)");
  
     # Execute the query
  
  my $stmh-&gt;execute();
  
     # Tidy up
  
  my $stmh-&gt;finish();
  my $dbh-&gt;commit or die my $DBI::errstr;
  </code></pre>
  
  <p>I could not run the <strong>contact.pl</strong> code 
  It said <strong>"Internal Server Error"</strong></p>
  
  <p>Is there anyway I could correct this?</p>
  
  <p>Thanks alot in advance</p>
  
  <p>Thank you
  I had already edited the code as you said but it is having error with
  After <strong>updating:</strong>
      Internal Server Error</p>
  
  <pre><code>The server encountered an internal error or misconfiguration and was unable to complete your request.
  Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.
  
  Premature end of script headers: /home/friendcontact/private/cgi-bin/contact.pl
  </code></pre>