Current location: Hot Scripts Forums » Programming Languages » Perl » Simple Guestbook, 500 Internal Error


Simple Guestbook, 500 Internal Error

Reply
  #1 (permalink)  
Old 11-17-03, 01:29 PM
wake wake is offline
New Member
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Simple Guestbook, 500 Internal Error

I have to write a perl script for class. I had to learn Perl on my own, so I'm just getting into it. I have a book that goes through on how to complete a GuestBook for a website. The final assignment is going to be a Wedding Registry, but I figure if I can get the GuestBook completed, I can modify it with no problems.

Perl works correctly on my host, so I know there isn't an issue with that. I just can't figure out why I've copied everything from the book, yet it doesn't work.

The current script is located at http://www.lanceselgo.com/book.html Currently all it does is show the form, and you can submit it. (Supposedly) I don't have the viewing of the guestbook done yet because I haven't been able to get around this first problem.

The code can be downloaded at: http://www.lanceselgo.com/guestbook_ls.zip

I didn't know if it would be easier to download it, or make this post really big.

I have chmod'd the script to 755, and that's about all I can say. I don't have a clue what to try next. Thanks in advance.

Lance
Reply With Quote
  #2 (permalink)  
Old 11-17-03, 01:55 PM
Chas Chas is offline
Coding Addict
 
Join Date: Oct 2003
Location: California
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
Hey Lance,

You have a case problem on line 56 in addguest.pl:

Code:
    &HTML_Header ("All done!");

    # Should be:
    &HTML_header ("All done!");
If you have access to your error logs, you can usually find the exact error there. It takes a while to figure out what some of the messages mean but you get used to it real fast If not, a handy tool is CGI::Carp. Just add the following line to your script somewhere under the shebang line:

Code:
#!/usr/bin/perl -w
use CGI::Carp qw/fatalsToBrowser/;
That will send the errors to the browser in addition to the error log.

See the CGI::Carp pod for more details and features.

~Charlie
Reply With Quote
  #3 (permalink)  
Old 11-18-03, 01:23 AM
wake wake is offline
New Member
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks a lot Charlie, I'll try that out. I'm very new to Perl so I'm not all with it. I appreciate your generous response.

Lance

Quote:
Originally Posted by Chas
Hey Lance,

You have a case problem on line 56 in addguest.pl:

Code:
    &HTML_Header ("All done!");

    # Should be:
    &HTML_header ("All done!");
If you have access to your error logs, you can usually find the exact error there. It takes a while to figure out what some of the messages mean but you get used to it real fast If not, a handy tool is CGI::Carp. Just add the following line to your script somewhere under the shebang line:

Code:
#!/usr/bin/perl -w
use CGI::Carp qw/fatalsToBrowser/;
That will send the errors to the browser in addition to the error log.

See the CGI::Carp pod for more details and features.

~Charlie
Reply With Quote
  #4 (permalink)  
Old 11-18-03, 09:45 AM
Chas Chas is offline
Coding Addict
 
Join Date: Oct 2003
Location: California
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by wake
Thanks a lot Charlie, I'll try that out. I'm very new to Perl so I'm not all with it. I appreciate your generous response.
No problem, Lance. Let me know if you run into any more troubles.

Quote:
I'm very new to Perl...
Everybody has to start somewhere. I've been there (I'm still there in some aspects), I know how you feel

~Charlie
Reply With Quote
  #5 (permalink)  
Old 11-21-03, 01:49 AM
Millennium's Avatar
Millennium Millennium is offline
Wannabe Coder
 
Join Date: Nov 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by wake
I have to write a perl script for class. I had to learn Perl on my own, so I'm just getting into it. I have a book that goes through on how to complete a GuestBook for a website. The final assignment is going to be a Wedding Registry, but I figure if I can get the GuestBook completed, I can modify it with no problems.

Perl works correctly on my host, so I know there isn't an issue with that. I just can't figure out why I've copied everything from the book, yet it doesn't work.

The current script is located at http://www.lanceselgo.com/book.html Currently all it does is show the form, and you can submit it. (Supposedly) I don't have the viewing of the guestbook done yet because I haven't been able to get around this first problem.

The code can be downloaded at: http://www.lanceselgo.com/guestbook_ls.zip

I didn't know if it would be easier to download it, or make this post really big.

I have chmod'd the script to 755, and that's about all I can say. I don't have a clue what to try next. Thanks in advance.

Lance

In addition to Chas's suggestion:

500 internal error can be from:

incorrect path to perl, which is the first line of the script

Script is uploaded in binary mode instead of ASCII mode

The script istrying to print something to the screen before printing an HTTP header

any syntax error will also crash a Perl script
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Connection error '800a0bb9' - HELP! seala ASP 1 03-09-05 05:37 AM
php error i never seen please help darkcarnival PHP 4 11-15-03 11:28 AM
Creating a simple Guestbook Mickells23 ASP.NET 1 11-14-03 09:46 PM
a parse error i need help on darkcarnival PHP 14 11-14-03 02:37 PM
Can't find the error. Mister B. ASP 12 08-27-03 06:18 PM


All times are GMT -5. The time now is 04:46 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.