By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,773 Members | 1,724 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,773 IT Pros & Developers. It's quick & easy.

Perl Communication with html

P: 2
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.
Expand|Select|Wrap|Line Numbers
  1. #!C:\Perl\bin
  2. require "cgi-lib.pl";
  3.  
  4. &ReadParse(*input);
  5.  
  6. print "Content-Type: text/html\n\n";
  7. print "<html> <head>\n";
  8. print "<title>User Name</title>\n";
  9. print "</head>\n";
  10. print "<body>\n";
  11.  
  12. print "You typed: " . $input{'username'} . "\n";
  13.  
  14. print "</body> </html>\n";
  15.  
  16.  
  17. <html
  18. <head>
  19. <title>My name form</title>
  20. </head>
  21. <body>
  22. <form action="http://localhost/cgi-bin/name1.cgi" method="get">
  23. My NAME:
  24. <input type="text" name="username" />
  25. <br />
  26. <input type="submit" />
  27. </form>
  28. </body>
  29. </html>
  30.  
Mar 1 '10 #1
Share this Question
Share on Google+
3 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
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
Mar 1 '10 #2

eWish
Expert 100+
P: 971
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.

Expand|Select|Wrap|Line Numbers
  1. use CGI::Carp qw/fatalsToBrowser/;
Mar 2 '10 #3

Expert Mod 100+
P: 589
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.
Mar 2 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.