CS 101 Web Construction, Fall
2017 , Instructor: Jeffrey Horn ASSIGNMENTS
- Assignment 5 "FORMS and Server-side Scripts"
- Handed out: Tuesday, October 3, 2017
- Due: Friday, Oct. 20, 2017
- Reading:
- Chapter 6 of the Jamsa textbook (All
of Ch.6! It is short and all of the sections have good
material. )
- Note that there seems to be a problem with
the textbook's server: It won't run the two server-side
scripts (FormEcho.php and FileUploader.php) that are offered in Ch.
6 as examples that can be used by us, the readers, to test our html
forms. The textbook's server,
www.WebsiteDevelopmentBook.com, seems to be otherwise working,
serving up .html files, but for some reason it won't run the php
scripts. Since Jamsa gives the code for these two scripts, I
have typed them into files and put them on our Dept. server, where
they seem to running just fine. To use them, when trying
out the exercises in Ch. 6 or testing your code for A5, put the
following URLs into the
action
attribute for your <form> elements:
- I strongly recommend you use FormEcho to
test your code! It is very helpful in seeing what is
going on in this complex situation of multiple servers and files!
- Goals:
- Design and implement a web form, as an interface to an existing
server-based script (program).
- Learn to use several different versions of the <input> form element
(i.e., text, submit, hidden, password, all of which are values for
<input>'s "type" attribute).
- Learn to be the interface between user and (script) programmer
- Details:
- Create a web page (.html file) containing a
<form> that allows the web user to play the "secret code"
game.
- The CS 101 A5 script is at
http://euclid.nmu.edu/~jeffhorn/cgi-bin/A5.cgi Have your
form's action attribute point to this script, and
use "POST" for the value of the method attribute.
- Your form should ask the user to guess the secret
number (integer), 1-1000.
- To run the CS101 A5 script, your web page will need to send
these named data fields to the server-side script:
- secretcode: A text string with a number in
it. This will be the users guess as to the "Mystery
Number"!
- recipient: A real email address
(e.g., "jhorn@nmu.edu"). This should be hidden.
- fullname: Your full
name.
- firstname:
Your first name.
- lastname:
Your last name.
- nmuID: Your NMU
user name (e.g., mine is "jhorn"). This is NOT your
NMU IN!
- URL: This should
be the actual, public web address for your A5 assignment (see
below)
- Note that the names above are case-sensitive.
- Put your page on the web, but use a "cryptic" (i.e.,
non-obvious) URL, so as to discourage copying by other students!
(This is worth points!)
- When your form page is working, send me the URL by using your A5
form. Include your best guess of the mystery number! Instead of sending me an email
directly, try to get the server-side script to send me an email with
your URL for A5, and your name (in the body of the email message).