Help!!! - Perl

Discussion in 'Programming/Scripts' started by hunter13605, Mar 4, 2006.

  1. hunter13605

    hunter13605 New Member

    Code:
    #!/usr/bin/perl
    
    use CGI::Carp qw(fatalsToBrowser);
    use CGI;
    $query = new CGI;
    
    print $query->header;
    print $query->start_html(-title=>'Password demo');
    
    print "<FONT FACE = 'arial' SIZE = '2'>";
    print "<FORM ACTION = '/cgi-bin/pindemo2' METHOD = 'post' > ";
    print "<BR>Welcome! To begin the session, please enter your Personal Identification Number (PIN) and password. </B><BR><BR>";
    print "<TABLE>
    <TR>
    <TD><FONT FACE = 'arial' SIZE = '2'> PIN</TD>
    <TD> <INPUT TYPE='textbox' NAME='pin' SIZE='25' MAXLENGTH='30'></TD>
    </TR>
    <TR>
    <TD><FONT FACE = 'arial' SIZE = '2'> Password </TD>
    <TD> <INPUT TYPE='password' NAME='password' SIZE='25' MAXLENGTH='30'></TD>
    </TR>
    </TABLE>";
    
    print "<INPUT TYPE='submit' VALUE='Submit'>";
    print "</FORM>";
    print $query->end_html;
    
    This is code that i got from a tuitorial in a book. It works on the website that gose along with the book but when i try to run it from my webserver (PQD Networks) i get a 500 internal service error. I did have to change the first line of the code to point to the PERL directory.

    You can view the file on my server at http://www.match.nnysitedesigns.net/cig-bin/pindemo1.pl

    you can view the working version at:
    http://www.web-research-design.net/cgi-bin/pindemo1.pl

    :( Thanks in advanced.:)
     
  2. falko

    falko Super Moderator

    You must make sure that you saved the script with Unix linebreaks, not Windows linebreaks. Then you must make the script executable:
    Code:
    chmod 755 /path/to/pindemo1.pl
    And if you're using suExec, then the owner and group of the script must match the suExec user and group.
     

Share This Page