[Tutor] CGI Video collection application File I/O troubles

Guybrush Threepwood domain.admin at online.ie
Mon Dec 6 13:45:43 CET 2004

Quoting "Jacob S." <keridee at jayco.net>:

> Your error message says that you are getting an empty string from your cgi
> variable. I IMHO would suggest printing videodb['title'] before writing it
> to a file to see what the variable contains. Or you might print out videodb
> to see what the dictionary looks like.

Right!! That were my thoughts exactly. I think I even wrote this in my
email. Anyhoo, when I do a print videodb or print['videodb'] from the
script it prints the correct values to a new HTML file.

>My off the wall guess is that 1) Your
> cgi variables are not returning the value from the actual object that you
> want 2) The script is running and assigning values to title, etc. before the
> afore mentioned object is given a value. IOW, maybe you haven't assigned
> values to the form before you try to read them.
> Another suggestion. Comment out the file writing part and print everything
> to the screen to verify that the output is what you want. "When in doubt,
> print it out." - Jacob Schmidt
> HTH,
> Jacob

Ok. I tried running the script on my Apache server on Windows NT and IT
WORKS!!!! The script saves the values of videodb keys correctly. DARN!!!
I don't get it. Why does the exact same script work on Win and not on Linux.

Oh, did I mention I am developing the application on Linux. And now I tried
it on Win XP with Apache and it works. On Linux I have httpd too.


The lady on the call box in Monkey Island 2
Guybrush: I'm lost in the Inky Island Jungle in Monkey 2
Lady: Just walk off the edge of the screen

More information about the Tutor mailing list