473,324 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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.
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
3 1439
numberwhun
3,509 Expert Mod 2GB
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
971 Expert 512MB
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
RonB
589 Expert Mod 512MB
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

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

Similar topics

9
by: arjohn7481 | last post by:
Hello everyone, Can someone help me in deciding the development language? I need to develop a "regular console application" which will require - 1. Communication with another application over...
4
by: Keith | last post by:
All: What is the difference between Perl (CGI) and PHP (Apache module)? I thought both used servers to direct the user to the appropiate Perl or PHP program in order to execute the program to...
0
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile....
0
by: Goutam Paruchuri | last post by:
Hello all, Anyone has perl DBI working with Postgres 8-beta on Windows. I get the following error when i compile. I have POSTGRES_LIB and POSTGRES_INCLUDE set to the right locations. The...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
223
by: Pilcrow | last post by:
Given that UNIX, including networking, is almost entirely coded in C, how come so many things are almost impossible in ordinary C? Examples: Network and internet access, access to UNIX...
18
by: amy100 | last post by:
hi Im new to Perl. Im trying to write a program to send an e-mail via my cgi script. I tried various options - MIME::Lite, Sendmail, Mail::Sender, and none seem to work. I get no error message in...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.