NetProg 2002 HW4 FAQ


Question:

If I leave the name parameter to Window.open blank IE seems to work fine (I always get a new window), but the version of Netscape running on the CS machines doesn't give me new windows. How can I fix this?

Answer:

Use the name "_blank" for all windows, this works with IE and Netscape.




Question:

The demo system doesn't seem to work! I put in the url http://www.yahoo.com but nothing pops up.

Answer:

http://www.yahoo.com is not a valid URL, as it's missing the trailing '/'. I've adjusted the demo system to handle this (and other) situations. You don't have to handle this kind of stuff in your HW4, you can just assume the URL you have been given is valid.




Question:

I can't get the webserver on cgi2.cs.rpi.edu to execute my script. all it does is print out the perl code. I have set it as being able to be read and executed by anyone. Do you know what could be wrong?

Answer:

Use cgi.cs.rpi.edu for now. It appears that cgi2.cs.rpi.edu is not using the same rules to decide what should be executed (naming your program something.cgi doesn't seem to be enough...).

Update: labstaff says "To make a cgi file executable on cgi2, you must put it in the cgi-bin directory under public.html".




Question:

Since we are generating a web page based on user input, isn't there the possibility of the user inserting Javascript that could do nasty things? Do we need to worry about this?

Answer:

For this assignment you don't need to worry about this. In general you do need to worry! You should not put anything into a web page that is based on user input (from a form) without checking to make sure it doesn't include Javascript.

For a more complete description of the problem, check out http://www.cert.org/advisories/CA-2000-02.html




Question:

Help! My perl CGI program won't run on cgi.cs.rpi.edu, but it runs on some other web server. I've checked permissions, the name, the path to perl, etc.

Answer:

If your file came from a PC, it probably contains CRLF marking the end of lines, instead of just LFs (which is what the shell expects). Although perl doesn't care about this, the shell does, so it probably is not starting up perl. The simple fix is to run the program dos2unix on your file - this will strip the CRs from each line. Usage is dos2unix filename > newfile.




Question:

I can't seem to log on to cgi.cs.rpi.edu, how do I create/test my CGI program?

Answer:

You don't need to log on to cgi.cs.rpi.edu, just put your file(s) in your public.html directory. When testing your program from a browser, use cgi.cs.rpi.edu in the URL. The http server running on cgi.cs.rpi.edu knows where your files are.