Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server Error

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
Hi there,
I encounter a problem; I have no idea what it is.
One of my cgi program generate a form then pass the information to another cgi program, which will write the information into the data file. When I run the program under the command line, there is not problem, but when I submit the form. I got the message" Server Error". What kind of the problem that could be? There is nothing to with the mod. I have tried to chmod 777(both dir and file), but still the same. Since there is not syntax error, I don't know what to do. Any help will be great.
Thank you!!
 
Your problem may be the path to the file that you are writing. You normally need to specify the complete path in a cgi program. You can also use the environment variable $ENV{'DOCUMENT_ROOT'} as part of the path. This is the path to your "web" directory (where your cgi directory and web pages reside).

Also, don't forget that you need to print something to the broswer, and you need a content-type header as the first thing. Like:
Code:
print "Content-type: text/html\n\n";
There MUST be TWO \n's at the end.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thank you!
Yes, the problem is about the content-type header.
I checked my print_header function, which I wrote it a while ago and use it in most of my programs. This function didn't have the line &quot;Content-type:text/html&quot; and <html><head> tags in it. When the .cgi programs use this function, they need write them in.
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top