PDA

View Full Version : Having trouble with cgi output


LeafWind
03-09-1999, 10:12 PM
Okay, I am very new to cgi, so far I've mostly figured out print commands and other output related stuff, not the actual programming.

Right now I have a program that produces 3 similar pages from what's in the cgi file. For each page, there is a header area done with
print<<whatever;
html stuff
whatever
then it calls another cgi file (which is only info, as in not changing, and only called in that particular case) by saying
require "filename.cgi";
then there's a footer section (of html) that's also done with
print<<whatever;
html stuff
whatever

Now, it works just fine for the first page. On the second page, it *only* calls the header stuff -- I can look at the source code of the output in my browser and it doesn't go further than that. It's not recording anything in my scripts logs. I've checked and checked and I can't figure out anything that's different between the first page and the second. I'm lost about how to fix it. Any ideas about how I can figure out where the problem is?

Btw, I've been doing all this by editing in my text editor and uploading by FTP -- I don't know where to begin with telnet (although I do think I have a telnet program somewhere in here).

Thanks in advance,

Bekariso

------------------
www.LeafWind.com (http://www.LeafWind.com)
Growing web sites that thrive in the winds of change.

hearts
03-09-1999, 10:28 PM
while chewing on m&m's.. i am trying to hear my head sort this out.. I guess what I would like to ask is, before you did any editing, what did you see on these pages? DID this script show the header/footer on all three pages?

It is hard for me to help without seeing this code.. (the whole thing) .. what I would suggest doing, is (hopefully you have a copy of the original code in its original state).. and compare the two to see where the error lies.

Del
03-09-1999, 10:34 PM
Somewhere towards the top of your script (under the shebang line though) add this line;

use CGI::Carp qw(fatalsToBrowser);

If your script is returning an error, fatalsToBrowser should return a semi-intelligent error message directly to your browser (hence the name *s*). This may or may not work for you though, as it may not be a fatal error that you are encountering.

Oh yeah, make double sure that the path to any required files is correct, as sometimes this can cause the behaviour you are describing.

Del

LeafWind
03-10-1999, 08:45 PM
I did it! I got it to work!

It was hard to figure out anything last night, because the sprintlink connection kept hiccuping and dumping me off FTP and I could only check things in the browser once every 5 minutes or so (if I timed it right). Hearts' question about what it did before I started tweaking made me realize that I hadn't actually checked *that* combo of pages in my copies of the unzipped files. When I checked again today, I realized that buddyprogrammer had set up his
print<<whatever;
blah blah
whatever
command thingies by using "whatever" signal words that actually appeared in the blah blah. Doh! Once I changed them to more obscure words, it all works fine. Woohoo!! I've been working on this script off and on for 2 weeks! If I had known it would be this difficult, I probably wouldn't have started, but I'm glad because I learned so much. Definately gotta learn perl myself someday -- I like making it work. http://www.aota.net/ubb/wink.gif

Thanks for your input and support, and Del: though it didn't help this time, I will definately hang on to that script command line for later use!

Bekariso http://www.aota.net/ubb/biggrin.gif

------------------
www.LeafWind.com (http://www.LeafWind.com)
Growing web sites that thrive in the winds of change.