|
|
|
|||||||
|
||||||||
|
|
|
|||||||
Handout #6 - CSCI 244201 - After setting up IIS, create a directory called handout6 inside of the directory used by localhost. This directory will contain 3 files called index.htm, form2.asp and photo1.jpg. The index.htm file will contain three input tags, the first is of type text and should be called username, the second is of type password and should be called password1 while the third is of type submit and should be labeled submit. Use the post method for the form and have the action direct the results to form2.asp. Title the form "Handout 6 - ASP Example" label the input tags. Add various CSS attributes position the input elements as well as apply colors and font styles. 02 - The file form2.asp will begin with standard html tags inside the head section. Use the same embedded CSS scheme for fonts and colors as was used in index.htm. Inside the body tag, create two variables called username and password1 then set them equal to the values passed in from index.htm. Next, seven variables caleld rightnow, currentmonth, currentday, currentyear, currenthour, currentminute, currentdaynumber. Use the various VBScript date functions descriped in class to set these values to the current time and date on the server. Next, create an array called message with seven entries, message(0) through message(6). Populate this array with strings describing what programs are on TV for that evening. For example, message(0) should contain a string for what is on Sunday night, message(1) for Monday night, etc. 03 - Create an if/else structure which tests if username is set to "jsmith" and password1 is set to "qwerty". If both of these statements are true, carry ou the instructions in Step 4. If this statement is not true, display the message "Invalid Username and/or Password" followed by a button which directs the user back to index.htm. 04 - If both statements are true, display the message "Welcome Jane Smith" followed by an image tag containing photo1.jpg. Below the image, display the message "The current date is MM--DD--YYYY" where MM, DD and YYYY correspond to the variables currentmonth, currentday and currentyear. Make sure to place "--" symbols between each value. Below the date message, display the message "The current time is HH : MM" where HH and MM correspond to the variables currenthour and currentminute. Below the time message, display the message() array element corresponding to the appropriate day. This message should be followed by a button which directs the user back to index.htm. 05 - Test out your script by first entering username "tjohnson" and password "hello" as values then perform a screen capture of the result. Next, enter username "jsmith" and password "qwerty" as values then perform a screen capture of the result. Next, adjust your system time and date as demonstrated in class to one day ahead, then enter username "jsmith" and password "qwerty" as values. Perform a screen capture of the result. Reset your system clock back top the original value. Turn in your three screen captures, along with source code for both index.htm and form2.asp. A working example of this code can be found HERE BACK |
||||||||