Perl Communication with html

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Divakar109
    New Member
    • Feb 2010
    • 2

    Perl Communication with html

    This is my code for passing values from HTML to perl ,my cgi-lib.pl and perl scripts are in cgi-bin folder but I am getting http 500 internal server error whilre executing plz help.
    Code:
    #!C:\Perl\bin
    require "cgi-lib.pl";
    
    &ReadParse(*input);
    
    print "Content-Type: text/html\n\n";
    print "<html> <head>\n";
    print "<title>User Name</title>\n";
    print "</head>\n";
    print "<body>\n";
    
    print "You typed: " . $input{'username'} . "\n";
    
    print "</body> </html>\n";
    
    
    <html
    <head>
    <title>My name form</title>
    </head>
    <body>
    <form action="http://localhost/cgi-bin/name1.cgi" method="get">
    My NAME:
    <input type="text" name="username" />
    <br />
    <input type="submit" />
    </form>
    </body>
    </html>
    Last edited by numberwhun; Mar 1 '10, 04:16 PM. Reason: Please use CODE tags!!!
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    I guess my first question, since you are on windows, is do you have your web server service turned on? Lets start there.

    Regards,

    Jeff

    Comment

    • eWish
      Recognized Expert Contributor
      • Jul 2007
      • 973

      #3
      Add this line of code to your script and see what it tells you. Also, the cgi-lib.pl has been depreciated for a long time. CGI.pm is a better choice.

      Code:
      use CGI::Carp qw/fatalsToBrowser/;

      Comment

      • RonB
        Recognized Expert Contributor
        • Jun 2009
        • 589

        #4
        Why are you sending 2 sets of head and body tags? Your second opening head tag is not terminated and lines 17 - 29 are unquoted strings. Those 2 issues are the cause of your 500 error.

        Comment

        Working...