Homework 4 Frequently Asked Questions

  1. Do we need to error check input for maliciousness or valid email addresses?
    No. In this assignment, Justin and I will only use valid input for names and email addresses to add.
  2. Can we use a Windows server to do this?
    If you really have a strong desire to do that, be my guest. However, note that I will not be overly likely to give advice or assistance with anything having to do with Windows. Note furthermore that your URL must be valid whenever I get to grading your assignment, so if you run this from your Windows box, make sure your server is up and running from the due date until you receive your grade.
  3. Can we assume that every entry will have a distinct name and email?
    Not quite. You may presume that no two people will have the same email address. However, you may not assume that two people will not have the same first or last names.
  4. "Why isn't anything working!?"
    A few people seem to be having difficulty getting their CS accounts 'working' correctly. There appear to be two main issues: getting files to your CS account, and getting your files on the web.
    To get your files to your CS account, you must use the SCP proticol. See the announcement from November 7th. If you download the Windows client, make sure you download version 1.0, not the version 2.0 Beta. If you want to transfer a file from the current directory of your RCS account to the public.html directory of your CS account, this is the command to do it:
    scp index.html solaris.remote.cs.rpi.edu:~/public.html
    If you are asked "Are you sure you want to continue connecting", type 'yes'. Typing 'y' is not sufficient. If scp or ssh give you errors saying that the host key conflicts with .ssh/known_hosts, simply remove the file by typing
    rm .ssh/known_hosts
    Secondly, to get your HTML and CGI files to display on the web (all commands are being typed from your home directory):
    1. If you do not have a public.html directory, create one:
      mkdir public.html
    2. You must then make the directory world-readable and world-executable:
      chmod o+rx public.html
    3. If you want to use cgi2.cs.rpi.edu, you must create a cgi-bin directory:
      mkdir public.html/cgi-bin
    4. And make this directory world-readable and world-executable as well:
      chmod o+rx public.html/cgi-bin
    5. Next, put your files in your public.html directory (or the cgi-bin subdirectory, if you're using cgi2.cs)
    6. Make each of your HTML files world-readable, and each of your CGI files user-executable:
      chmod o+r public.html/*.html
      chmod u+x public.html/*.cgi
      For a review of how to see what the permissions are for a given file, consult the manpage for ls, or review the Intro to Unix slides on the main course webpage
    7. Finally, be sure that your she-bang is correct on all CGI scripts. It must read
      #!/usr/local/bin/perl
      and it must be the first line of the file (before any whitespace or comments). Don't forget that first slash, immediately after the #!
    If you are 100% sure you've followed all of these directions correctly, and still "nothing's working!", then feel free to email me
  5. When I try to run my program from the command line, I get an error like "no such file or directory" or "command not found". Why?
    The CS Accounts, by default, do not have the current directory in the path. If you are a Unix guru, and know what this means, feel free to add the current directory to your path. If not, just run the program by giving the current directory. For instance, for me to run a script called "lallip.cgi", I would type:
    ./lallip.cgi
  6. Why doesn't my table display in the script? It works on the command line!
    There are different versions of CGI.pm installed on cgi.cs, cgi2.cs, and solaris.remote.cs. The CGI machines don't have the most updated version of CGI.pm (so it seems). Instead of trying to print the CGI shortcuts for table tags, just print the straight HTML <table>...</table> tags.