|
|
|
|
Random (Mostly) Web Design Web Sites:
|
|
|
Computer Humor
How many BASIC programmers does it take to screw in a light bulb?
10 push bulb upwards : twist bulb clockwise : goto 10 |
|
|
Click for Instructions
Click on the date to open the details.
Click date again to close the details.
|
| Day |
Date |
|
Discussion |
|
| 1 |
04/02/07 |
|
Monday - English & ASP |
|
- Classroom Discussion -
- English - wordsmith.org - Anagrams
- ASP - from w3schools.com:
- Introduction
- Install
- Syntax
- Variables
- Lab Assignment -
- Use ASP to write "Hello World":
- Reference the w3schools.com web site
- Create a new web page "helloWorld.asp"
- Write "Hello World" three different ways: HTML text, JavaScript, & ASP
- Use a variable with your name to write hello to yourself
- Use a variable to display the date & time
- With the time, display either "Good Morning" or "Good Afternoon" or "Good Evening"
- Test
- Correct any errors
- Re-Test
- Save in "toBeGraded"
- To test ASP web pages:
- Copy the file to "C:/Inetpub/wwwroot/" folder
- Open a new browser window
- Change the address to read "localhost/css50/fileName.asp" where filename is the name of your web page
- Click "go" or press enter
|
| 2 |
04/03/07 |
|
Tuesday - Science & ASP |
|
- Classroom Discussion -
- Science - howStuffWorks.com - How Numerology Works
- ASP - from w3schools.com:
- Procedures
- Lab Assignment -
- Use ASP procedures to make a simple calculator:
- Reference the w3schools.com web site
- ASP procedures belong in the <HTML> <HEAD> section
- Create procedures for add(), sub(), mult(), & div()
- Each procedure will accept two numerical variables passed inside the parenthesis
- Each procedure will perform the correct calculation (add, subtract, multiply, or divide)
- The subtract procedure will always return a positive result (don't subract a large number from a small one)
- The divide procedure will not allow a "divide by zero" error
- Write four simple ASP lines in the <BODY> section to call each of the four procedures
- Test
- Correct any errors
- Re-Test
- Save in "toBeGraded"
- To test ASP web pages:
- Copy the file to "C:/Inetpub/wwwroot/" folder
- Open a new browser window
- Change the address to read "localhost/css50/fileName.asp" where filename is the name of your web page
- Click "go" or press enter
|
| 3 |
04/04/07 |
|
Wednesday - Career & ASP |
|
- Classroom Discussion -
- Career - A Clarke PowerPoint Presentation - The Top 10 Reasons to Major in Computing
- Career - ACM.org - The Top 10 Reasons to Major in Computing
- ASP - from w3schools.com:
- Forms
- Lab Assignment -
- Use ASP procedures to make a more complex calculator:
- Reference the w3schools.com web site
- ASP procedures belong in the <HTML> <HEAD> section
- Create two new ASP web pages:
- "calc.asp" will use forms to allow the user to enter data & choices & then call "calc2.asp"
- "calc2.asp" will perform the proper calculation & display the answer
- Create "calc.asp"
- A form named "myForm", "action=calc2.asp", "method=post"
- A table with 4 rows & 2 columns, like this:
- Create "calc2.asp":
- A form named "myForm", "action=", "method="
- A table with 1 row & 2 columns, like this:
| Read the Answer |
/*the answer will go here*/ |
- Write the ASP code in the <HEAD> to read the data from the first page:
- Remember to use the opening ASP HTML tag (<%)
- Create variables for "n1" & "n2" & "action" & "ans", example: dim n1
- Use "request.form(fieldName)" to assign data from the first page into the correct variable, example: n1 = request.form("num1")
- Use a nested decision statement to determine the value of the variable "action", example: if action = "add" then ...
- Perform the correct calculation & assign the answer to the variable "ans", example: ans = n1 & " plus " & n2 & " equals " & (CInt(n1) + CInt(n2))
- Use CInt(aTextNumber) to turn the text "55" into the number 55
- Remember to use the closing ASP HTML tag (%>)
- Write the ASP code in the <BODY> to display the answer to the user:
- Remember to use the opening ASP HTML tag (<%)
- Display the answer, example: response.write(ans)
- Remember to use the closing ASP HTML tag (%>)
- Test
- Correct any errors
- Re-Test
- Save in "toBeGraded"
- To test ASP web pages:
- Copy the file to "C:/Inetpub/wwwroot/" folder
- Open a new browser window
- Change the address to read localhost/css50/fileName.asp where filename is the name of your web page
- Click "go" or press enter
|
| 4 |
04/05/07 |
|
Thursday - Math & ASP |
|
- Classroom Discussion -
- Math - Ms. Verde & ???
- ASP - from w3schools.com:
- Cookies
- Sessions
- Lab Assignment -
- Add a cookie to your "calc.asp" first page:
- Open the file
- Add ASP to look for a cookie "welcome"
- If the cookie exists, say hello & display the rest of the first page
- If the cookie does not exist, display a form to get user name & write the cookie & reload the first page
- Test
- Correct any errors
- Re-Test
- Save in "toBeGraded"
- To test ASP web pages:
- Copy the file to "C:/Inetpub/wwwroot/" folder
- Open a new browser window
- Change the address to read localhost/css50/fileName.asp where filename is the name of your web page
- Click "go" or press enter
|
|
04/06/07 |
|
Friday - OCVTS School Closed - Spring Break |
|
|
04/09/07 |
|
Monday - OCVTS School Closed - Spring Break |
|
04/10/07 |
|
Tuesday - OCVTS School Closed - Spring Break |
|
04/11/07 |
|
Wednesday - OCVTS School Closed - Spring Break |
|
04/12/07 |
|
Thursday - OCVTS School Closed - Spring Break |
|
04/13/07 |
|
Friday - OCVTS School Closed - Spring Break |
|
| 6 |
04/16/07 |
|
Monday - English & VBScript & Volunteer Project |
|
- Classroom Discussion -
- English - ambigram.com - words that read forwards & backwards
- Web Programming - VBScript is a Microsoft scripting language similar to Netscape's JavaScript:
- Lab Assignment - View Large Image
- Use VBScript & ASP to create a pizza order web site:
- To test ASP web pages:
- Copy the file to "C:/Inetpub/wwwroot/" folder
- Open a new browser window
- Change the address to read localhost/css50/fileName.asp where filename is the name of your web page
- Click "go" or press enter
- Marking Period 4 Project
|
| 7 |
04/17/07 |
|
Tuesday - Science & VBScript & Volunteer Project |
|
- Classroom Discussion -
- Science - howStuffWorks.com - Fuel Cells
- Web Programming - VBScript is a Microsoft scripting language similar to Netscape's JavaScript:
- Lab Assignment - View Large Image
- Use VBScript & ASP to create a pizza order web site:
- Create "pizza2.asp"
- Write procedures to process data
- Call procedures
- Get results from procedures
- Use a text area to display the current customer order
- Use text boxes to get the delivery information:
- Name
- Address
- Room or Apartment Number
- City
- Phone
- Use radio buttons to allow the user to specify paid by Cash or Credit/Debit
- If Credit/Debit, display a text box to get the card number
- Use two command buttons: Change Order ("history.back()") & Submit Order (submit to form action "pizza3.asp")
- To test ASP web pages:
- Copy the file to "C:/Inetpub/wwwroot/" folder
- Open a new browser window
- Change the address to read localhost/css50/fileName.asp where filename is the name of your web page
- Click "go" or press enter
- Marking Period 4 Project
|
| 8 |
04/18/07 |
|
Wednesday - Career & VBScript & Volunteer Project |
|
- Classroom Discussion -
- Career - daveSite.com - Reasons to be a Computer Science Major
- Web Programming - VBScript is a Microsoft scripting language similar to Netscape's JavaScript:
- Lab Assignment - View Large Image
- Use VBScript & ASP to create a pizza order web site:
- Create "pizza3.asp"
- Use conditions to decide which statements will be processed
- Display a confirmation message
- Display the total cost
- Use a text area to display the delivery address
- Display a thank you & enjoy your pizza message
- Use a command button: Close Window ("window.close()")
- To test ASP web pages:
- Copy the file to "C:/Inetpub/wwwroot/" folder
- Open a new browser window
- Change the address to read localhost/css50/fileName.asp where filename is the name of your web page
- Click "go" or press enter
- Marking Period 4 Project
|
| 9 |
04/19/07 |
|
Thursday - Math & VBScript & Volunteer Project |
|
- Classroom Discussion -
- Math - newdream.net - Fun with Numbers
- Web Programming - VBScript is a Microsoft scripting language similar to Netscape's JavaScript:
- Lab Assignment -
- Use VBScript & ASP to create a pizza order web site:
- Use loops to process statements iteratively
- To test ASP web pages:
- Copy the file to "C:/Inetpub/wwwroot/" folder
- Open a new browser window
- Change the address to read localhost/css50/fileName.asp where filename is the name of your web page
- Click "go" or press enter
- Marking Period 4 Project
|
| 10 |
04/20/07 |
|
Friday - SkillsUSA & VBScript & VBScript Quiz & Volunteer Project |
|
- Classroom Discussion -
- SkillsUSA - -
- Web Programming - VBScript is a Microsoft scripting language similar to Netscape's JavaScript:
- Lab Assignment -
- VBScript & ASP Quiz 1 - Print for your records (in case the database fails)
- Use VBScript & ASP to create a pizza order web site:
- Complete the site
- To test ASP web pages:
- Copy the file to "C:/Inetpub/wwwroot/" folder
- Open a new browser window
- Change the address to read localhost/css50/fileName.asp where filename is the name of your web page
- Click "go" or press enter
- Marking Period 4 Project
|
|
| 11 |
04/23/07 |
|
Monday - English & Project - Toms River Closed |
|
|
| 12 |
04/24/07 |
|
Tuesday - Science & Project - Toms River Closed |
|
|
| 13 |
04/25/07 |
|
Wednesday - Career & Project - Toms River Closed |
|
|
| 14 |
04/26/07 |
|
Thursday - Math & Project - Toms River Closed |
|
|
| 15 |
04/27/07 |
|
Friday - SkillsUSA & Project - Toms River Closed |
|
|
|
| 16 |
04/30/07 |
|
Monday - English & ASP & Project |
|
- Classroom Discussion -
- English - say-it-in-english.com - how strange can a language be?
- ASP - from w3schools.com:
- Error Object - display detailed information of any error that occurs
- 15seconds.com - ASP and the error handler
- Lab Assignment -
- Create an ASP web page "errorDemo.asp" to catch a "divide by zero" error & continue to run:
- The first line in your ASP code should be "on error resume next"
- Declare a variable named "answer"
- Assign to "answer" the result of a division like "4 / 2"
- Check for an error number of zero:
If Err.Number <> 0 Then
- If true, Response.Write the error number & error description & error source
- If false, Response.Write the answer
- To test, change the divisor to zero & refresh the page
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 17 |
05/01/07 |
|
Tuesday - Science & ASP & Project |
|
- Classroom Discussion -
- Science - howStuffWorks.com - How Identity Theft Works
- ASP - from w3schools.com:
- File System - access the file system on the server
- Lab Assignment -
-
on error resume next
' put code that might produce any errors here
if Err.Number <> 0 then
' put code to show if there were any errors here
response.write("So sorry, we've encounted an error:<br>")
response.write("Error is " & Err.Number & "<br>")
response.write("Error is " & Err.Description & "<br>")
response.write("Error is " & Err.Source & "<br>")
else
' put code to run if there are no errors here
end if
- Create an ASP web page "fileSystemDemo.asp" to determine if a file exists:
- Declare a variable named "fn" for the file name:
dim fn
- Assign to variable "fn" the return from Server.MapPath(fileName):
fn = Server.MapPath("fileSystemDemo.asp") ' see that I'm really checking for the existance of the same file I'm viewing?
- Create a new object named "fs" to be a file system object:
Set fs=Server.CreateObject("Scripting.FileSystemObject")
- Check if the file exists:
If fs.FileExists(fn) Then
- If true, Response.Write that the file exists
- If false, Response.Write that the file doesn't exist
- To test, change the filename to "fileSystemDome.asp" & refresh the page
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 18 |
05/02/07 |
|
Wednesday - Career & ASP & Project |
|
- Classroom Discussion -
- Career - yahoo.com - four most common interview questions & how to answer them
- ASP - from w3schools.com:
- Text Stream - access the contents of a text file
- Lab Assignment -
- Create an ASP web page "fileReaderWriter.asp" to determine if a file exists:
- Copy the "fileSystemDemo.asp" page from yesterday & rename it
- Declare a variable named "fn" for the file name:
dim fn
- Assign to variable "fn" the return from Server.MapPath(fileName):
fn = Server.MapPath("fileSystemDemo.asp") ' see that I'm really checking for the existance of the same file I'm viewing?
- Create a new object named "fs" to be a file system object:
Set fs=Server.CreateObject("Scripting.FileSystemObject")
- Check if the file exists:
If fs.FileExists(fn) Then
- If true, Response.Write that the file exists
- Set a new object named "fileIn" to represent the file for input reading:
set fileIn=fs.OpenTextFile(fn,1,false)
- Read the entire file as a text string into a new variable named "str":
dim str : str=fileIn.ReadAll
- Close the input file, we're done with it:
fileIn.close
- Display the file input to the user:
Response.Write("The text in the file is: " & str & "<br>")
- Reverse the input text string to another new variable named "rev":
dim rev : rev = StrReverse(str)
- Display the reversed string to the user:
Response.Write("Reverse the text to get: " & rev & "<br>")
- If false, Response.Write that the file doesn't exist
- To test, change the filename to "textIntoit.asp" & refresh the page
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 19 |
05/03/07 |
|
Thursday - Math & ASP & Project |
|
- Classroom Discussion -
- Math - practicalMoneySkills.com - cars & loans
- ASP - from w3schools.com:
- Drive - return information about a local disk drive
- File - return information about a specified file
- Folder - return information about a specified folder
- Lab Assignment -
- Create an ASP web page "driveDemo.asp" to display attributes of a drive:
- ASP code:
Dim fs, d, out
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set d=fs.GetDrive("c:")
Response.Write("Details for Drive: " & d & "<br>")
Response.Write("Available Space in bytes: " & d.AvailableSpace & "<br>")
Response.Write("Free Space in bytes: " & d.FreeSpace & "<br>")
Response.Write("Total Size in bytes: " & d.TotalSize & "<br>")
Response.Write("Drive Type: " & d.DriveType & "<br>")
Response.Write("File System: " & d.FileSystem & "<br>")
Response.Write("Drive is Ready: " & d.IsReady & "<br>")
Response.Write("Serial Number: " & d.SerialNumber & "<br>")
Response.Write("Share Name: " & d.ShareName & "<br>")
Response.Write("Volume Name: " & d.VolumeName & "<br>")
set d=nothing
set fs=nothing
- Create an ASP web page "fileDemo.asp" to display attributes of a drive:
- ASP code:
dim fn : fn = Server.MapPath("textIn.txt")
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set fileIn=fs.GetFile(fn)
Response.Write("The attributes of the folder are: " & fileIn.Attributes & "<br>")
Response.Write("The file was created on: " & fileIn.DateCreated & "<br>")
Response.Write("The file was last accessed on: " & fileIn.DateLastAccessed & "<br>")
Response.Write("The file was last modified on: " & fileIn.DateLastModified & "<br>")
set fileIn = nothing
set fs=nothing
- Create an ASP web page "folderDemo.asp" to display attributes of a drive:
- ASP code:
dim fn : fn = Server.MapPath("textIn.txt")
response.write(fn & "<br>")
dim p : p = InStrRev(fn,"\")
response.write(p & "<br>")
dim str : str = left(fn,p)
response.write(str & "<br>")
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder(str)
response.write("These are the files in folder " & fo & "<br>")
for each x in fo.files
'Print the name of all files in the test folder
Response.write(x.Name & "<br>")
next
set fo=nothing
set fs=nothing
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 20 |
05/04/07 |
|
Friday - SkillsUSA & ASP & Project |
|
|
|
| 21 |
05/07/07 |
|
Monday - English & ASP & Project |
|
- Classroom Discussion -
- English - Computer Terminology - a humorous account
- ASP - w3schools.com - AdRotator - display a different image each time a user enters or refreshes a page
- Lab Assignment -
- Create a new web page "adRotatorDemo.asp":
- Find 4 images on the internet, save them to your "inetpub/wwwroot/css##/" folder
- It's best if they're about 440 pixels wide by 60 pixels high
- If your images are way off size, set the height & width sizes before the star in the text file
- Create a text file named "something.txt" to describe the images you want to display:
*
batmobile0.jpg
url link
Adam West's Batmobile in the TV Series
25
batmobile1.jpg
url link
Michael Keaton's Batmobile in the First Movie
25
batmobile2.jpg
url link
Christian Bale's Batmobile in the Most Recent Movie
25
batmobile3.jpg
url link
Ford Taurus Batmobile & Man in Bat Suit
25
- Add ASP code to your web page where you want the ad to display:
<%
set adrotator=Server.CreateObject("MSWC.AdRotator")
response.write(adrotator.GetAdvertisement("cars.txt"))
%>
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 22 |
05/08/07 |
|
Tuesday - Science & ASP & Project |
|
- Classroom Discussion -
- Science - howStuffWorks.com - How Light Sabers Work
- ASP - w3schools.com - Browser Capabilities - determine the type, capabilities and version number of each browser that visits your site
- Lab Assignment -
- Create a new web page "browserDemo.asp":
- Use the w3schools link above for source code
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 23 |
05/09/07 |
|
Wednesday - Career & ASP & Project |
|
- Classroom Discussion -
- Career - Five Hottest Technology Jobs - borrowed from the Internet
- ASP - w3schools.com - Content Linking - create a quick and easy navigation system
- Lab Assignment -
- Create a new web page "contentLinkingDemo.asp":
- Create the "links.txt" file to link a set of pages together with automatic "next" & "back" text links (use [TAB] between the URL & the description
contentLinkDemo1.asp Content Linking Demo 1
contentLinkDemo2.asp Content Linking Demo 2
contentLinkDemo3.asp Content Linking Demo 3
contentLinkDemo4.asp Content Linking Demo 4
- Create the "nlcode.inc" file that will be included in the ASP files to create the "next" & "back" text links:
<%
dim nl
Set nl=Server.CreateObject("MSWC.NextLink")
dim howMany : howMany = nl.GetListCount("links.txt")
if (nl.GetListIndex("links.txt")>1) then
Response.Write("<a href='" & nl.GetPreviousURL("links.txt"))
Response.Write("'>Previous Page</a> ")
end if
if (nl.GetListIndex("links.txt")<howMany) then
Response.Write("<a href='" & nl.GetNextURL("links.txt"))
Response.Write("'>Next Page</a>")
end if
%>
- Create four (4) identical ASP web pages, put in any text you want, be sure to include the line:
<!-- #include file="nlcode.inc"-->
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 24 |
05/10/07 |
|
Thursday - Math & ASP & Project |
|
- Classroom Discussion -
- ASP - w3schools.com - Content Rotator - display a different HTML content string each time a user enters or refreshes a page
- Lab Assignment - You may do both, you must do at least one:
- Create a new web page to display a different HTML content each time a user visits or refreshes the page:
- Follow the guidelines on the w3schools web page above
- Find a set of five useful, relevant, or humorous quotes from the internet & create the text file "text.txt"
- Create a text file named "textAds.txt" to hold the quotes
- Be sure to use the "%% #" 1 - 5 lines
- Create the web page named "contentRotatorDemo.asp"
- Add the lines to "set" & "write" the content from the text file
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Create a Microsoft PowerPoint project or a web site about the "Space Plane" project:
- google.com - search for space plane
- PowerPoint should have 6 or more slides
- A web site should have 3 or more pages
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 25 |
05/11/07 |
|
Friday - SkillsUSA PDP & ASP & Project |
|
|
|
| 26 |
05/14/07 |
|
Monday - Math & ASP ADO |
|
- Classroom Discussion -
- Math - Ms. Verde will visit & discuss latitude & longitude nationalGeographic.com - mapmaking
- ADO - w3schools.com - Home
- ADO - w3schools.com - Intro
- ADO - w3schools.com - Connect
- ADO - w3schools.com - Recordset
- Lab Assignment -
- Create a new web page "memberDisplay.asp" to display data in the "members.mdb" database:
- Copy the database "members.mdb" from the folder "Q:/access/membership/" to your folder "C:/inetpub/wwwroot/css##/"
- Save "memberDisplay.asp" to your inetpub folder
- Most ASP code goes where you want stuff it creates to be displayed
- Copy ADO connection code from the w3schools page:
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
%>
- Copy ASP code to map path from last week's web page "fileSystemDemo.asp":
dim fileName : fileName = Server.MapPath("member.mdb")
- Change the connection open line to use the variable name "fileName"
conn.Open fileName
- Copy & modify ASP code to catch errors from last week's web page "errorDemo.asp" to create an ASP subroutine in the "<head>" section:
<%
sub checkError()
If Err.Number <> 0 Then
response.write("Error Number: Err.Number<br>")
response.write("Error Description: Err.Description<br>")
response.write("Error Source: Err.Source<br>")
end if
end sub
%>
- Make sure the "on error" line is your first ASP code line:
on error resume next
- Call the ASP error check routine after you try the connection:
checkError()
- Check that is works -- change the file name to force it to break
- Copy ADO recordset code from the w3schools page, remember to change the table name:
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select * from member", conn
- Remember to call the ASP error check routine after you try the recordset:
checkError()
- Check that is works -- change the table name to force it to break
- Want to see it work?
for each x in rs.fields
response.write(x.name)
response.write(" = ")
response.write(x.value)
next
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 27 |
05/15/07 |
|
Tuesday - Science & ASP ADO |
|
- Classroom Discussion -
- Science - howStuffWorks.com - Animatronics
- ADO - w3schools.com - Display
- Lab Assignment -
- Modify the "memberDisplay.asp" from yesterday to organize the data displayed into a table:
- Remove the existing "response.write()" loop code
- Use ASP to write the "<table>" & "<tr>"tags:
response.write("<table border='1'><tr>")
- Use an ASP loop to write all the field names in table headers:
for each x in rs.fields
response.write("<th>" & x.name & "</th>")
next
- To test, you must use ASP to write the close "</tr>" & "</table>" tag:
response.write("</tr>")
response.write("</table>")
- Test -- Open a browser & test using "localhost/css##/memberDisplay.asp"
- To display record data in the table, place these lines after the "</tr>" tag but before the "</table>" tag:
do while not rs.eof
response.write("<tr>")
for each x in rs.fields
response.write("<td>" & x.value & "</td>")
next
response.write("</tr>")
rs.movenext
loop
-
-
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 28 |
05/16/07 |
|
Wednesday - Career & ASP ADO |
|
- Classroom Discussion -
- Career - PowerPoint - Interview Tips
- ADO - w3schools.com - Query
- ADO - w3schools.com - Sort
- Lab Assignment -
- Modify your existing "member.asp" web page to allow the user to select which fields to sort on & display:
- Rename "member.asp" to "memberDisplay2.asp"
- Create a table to organize the page display
- Create four (4) checkboxes:
- Name = chkFName & value = fName
- Name = chkLName & value = lName
- Name = chkCity & value = city
- Name = chkEMail & value = eMail
- Modify the "<form>" tag to "method='post'" & "action='memberDisplay2.asp'"
- Add command buttons for "Reset" & "Submit"
- Use "localhost" to load "memberDisplay.asp"
- Test that the "Submit" command button loads "memberDisplay2.asp" page
- The following code is added after the "conn.Open fileName" & "checkError()" lines
- Create variables for "fName", "lName", "city", "eMail" & load them with data using "request.form()":
dim fName : fName = request.form("chkFName")
dim lName : lName = request.form("chklName")
dim city : city = request.form("chkCity")
dim eMail : eMail = request.form("chkEMail")
- Create a variable for "tableName" & load your table name "member":
dim tableName : tableName = " member "
- Create a variable for "comma" & load it with a null value:
dim comma : comma = ""
- Create a variable for "sql" & start it with "SELECT ":
dim sql : sql = "SELECT "
- If none of the checkboxes (on the first page) are checked, then build your "sql" variable to select ALL the fields:
if fName="" and lName="" and city="" and eMail="" then
sql = sql & " * "
else
- Otherwise, determine which checkbox(es) are checked & build your "sql" variable, changing the "comma" variable as needed:
if fName<>"" then
sql = sql & fName
comma = ","
end if
if lName<>"" then
sql = sql & comma & lName
comma = ","
end if
if city<>"" then
sql = sql & comma & city
comma = ","
end if
if eMail<>"" then
sql = sql & comma & eMail
comma = ","
end if
end if
- Add the " FROM " & "tableName" to your "sql" variable:
sql = sql & " FROM " & tableName
sql = sql & ";"
- Display the "sql" variable during testing just to make sure it's correct:
response.write(sql & "<hr>")
- Modify the "rs.Open" line to use your "sql" variable:
rs.Open sql, conn
- Test thoroughly, check no boxes, check one box, check multiple boxes
- Add JavaScript code to the <head> section:
function showStuff(boxid) {
document.getElementById(boxid).style.visibility="visible";
}
function hideStuff(boxid) {
document.getElementById(boxid).style.visibility="hidden";
}
function showHide() {
var d = document.myForm;
if(d.chkFName.checked) { showStuff("divFName"); }
else { hideStuff("divFName"); }
if(d.chkLName.checked) { showStuff("divLName"); }
else { hideStuff("divLName"); }
if(d.chkCity.checked) { showStuff("divCity"); }
else { hideStuff("divCity"); }
if(d.chkEMail.checked) { showStuff("divEMail"); }
else { hideStuff("divEMail"); }
}
- Add four (4) text fields & labels & a "<div>" tag around each label & text field:
<div id="divFName" style="visibility:hidden">First Name <input name="txtFName" type="text" id="txtFName"></div>
<div id="divLName" style="visibility:hidden">Last Name <input name="txtLName" type="text" id="txtLName"></div>
<div id="divCity" style="visibility:hidden">City <input name="txtCity" type="text" id="txtCity"></div>
<div id="divEMail" style="visibility:hidden">E-Mail <input name="txtEMail" type="text" id="txtEMail"></div>
- Create a variable to hold the word " AND ":
dim strand : strand = ""
- The following code is added before the "sql = sql & ';'" line
- Add lines to create variables & "request.form()" checkbox data from the first page & build your "WHERE" statement:
if txtFName <> "" or txtLName <> "" or txtCity <> "" or txtEMail <> "" then
response.write("<hr>" & txtFName & txtLName & txtCity & txtEMail & "<hr>")
sql = sql & " WHERE "
if txtFName <> "" then
sql = sql & strand & " fName LIKE '%" & txtFName & "%' "
strand = " AND "
end if
if txtLName <> "" then
sql = sql & strand & " lName LIKE '%" & txtLName & "%' "
strand = " AND "
end if
if txtCity <> "" then
sql = sql & strand & " City LIKE '%" & txtCity & "%' "
strand = " AND "
end if
if txtEMail <> "" then
sql = sql & strand & " eMail LIKE '%" & txtEMail & "%' "
strand = " AND "
end if
end if
- Test thoroughly, search for different names & cities
- Add five (5) radio buttons named "sortOn" value "fName", "lName", "city", "eMail":
<input type="radio" name="sortOn" value="fName">First Name<br>
<input type="radio" name="sortOn" value="lName">Last Name<br>
<input type="radio" name="sortOn" value="city">City<br>
<input type="radio" name="sortOn" value="eMail">E-Mail<br>
<input type="radio" name="sortOn" value="none" checked>None
- The following code is added before the "sql = sql & ';'" line
- Add lines to create a variable & "request.form()" radio button data from the first page & build your "sql":
dim sortOn : sortOn = request.form("sortOn")
if sortOn <> "none" then
sql = sql & "ORDER BY " & sortOn
end if
- Test thoroughly, sort on different fields
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 29 |
05/17/07 |
|
Thursday - English & ASP ADO |
|
- Classroom Discussion -
- English - Ms. Gerick will visit & discuss wikipedia.com - Acrostic
- ADO - w3schools.com - Add
- Lab Assignment -
- Work on yesterday's "memberDisplay.asp" & "memberDisplay2.asp"
- Create a web page "acrostic.asp" to let the computer make acrostics:
- Copy the file "words.txt" from "Q:/webdesign/asp"
- Add a form named "myForm" method "post" action "acrostic.asp"
- Add a text field named "word"
- Add a command button "submit"
- Declare a variable "word" & assign the value of request.form("word")
- If the variable "word" is not empty, continue
- Copy code into the <body>:
dim fn : fn = Server.MapPath("words.txt") ' Declare a variable filename & mappath of the file "words.txt"
Set fs=Server.CreateObject("Scripting.FileSystemObject") ' Create the file system object
If fs.FileExists(fn) Then ' If the file exists, continue:
set fileIn=fs.OpenTextFile(fn,1,false) ' Open the text file
dim str ' Declare variables
dim a : a = "a"
dim i : i = 0
dim j : j = 0
dim startNum
dim endNum
dim ranNum
dim length
dim word : word = request.form("word")
dim words(5001)
dim aStart(30) : aStart(0) = 0
dim aLength(600)
set fileIn=fs.OpenTextFile(fn,1,false)
' Loop to read all words from the input file "words.txt" into the array variable "words()"
do while fileIn.AtEndOfStream = false
str = fileIn.readline
words(i) = lcase(str)
if a <> left(words(i),1) then
aLength(j) = i - aStart(j)
aStart(j+1) = i
a = left(words(i),1)
j = j + 1
end if
i = i + 1
loop
aLength(j) = i - aStart(j) ' Perform cleanup after the loop ends
fileIn.close
length = len(word) ' Figure out how long is the word to be acrosticized & tell the user
response.write(length & " words in my acrostics:<br>")
randomize ' Start the randomizer
' Loop for each letter in the word & choose a random word from the words() array
for i = 1 to length ' do every letter in the word
a = mid(word,i,1) ' get the first letter of the word
j = asc(a) - 97 ' figure out which number of the alphabet
startNum = aStart(j) ' starting position in the array of words()
endNum = aStart(j) + aLength(j) ' ending position in the array of words()
ranNum = round(rnd * (endNum - startNum)) + startNum ' get random number
response.write(words(ranNum) & "<br>") ' write the random word from the array of words()
next
' Clean up and end the open if statement
Else
Response.Write("Defeat<br>File " & fn & " does not exist.<br>")
End If
set fs=nothing
- Test thoroughly, refresh the page with the same word several times as well as different words
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 30 |
05/18/07 |
|
Friday - SkillsUSA PDP - PDP & ASP ADO |
|
|
|
| 31 |
05/21/07 |
|
Monday - English & ASP ADO |
|
- Classroom Discussion -
- Englis - Computer Puns - a PowerPoint Presentation
- English - eHumorCentral.com - Computer Puns
- English - wordsworx.co.nz - Fractured English
- ADO - w3schools.com - Command
- ADO - w3schools.com - Connection
- ADO - w3schools.com - Add
- Lab Assignment -
- Create the ability to add new data to your member pages:
- Add text field objects to allow the user to enter data for the six (6) fields in the database "member.mdb":
- User ID
- Password
- First Name
- Last Name
- City
- E-Mail
- Add labels to identify the text fields so the user knows what to type in the boxes
- Add instructions so the user knows what to do
- Add a command button [reset]
- Add a command button [submit] but make it a "button" button with an "onClick" & use a JavaScript section to make sure requred data is complete before submitting the form
- Write the JavaScript data validation section
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 32 |
05/22/07 |
|
Tuesday - Science & ASP ADO |
|
- Classroom Discussion -
- Science - How Tivo Works
- Science - How Wiretapping Works
- Science - How Missing Gravity Works
- Science - How Maps Work
- ADO - w3schools.com - Error
- ADO - w3schools.com - Field
- Lab Assignment -
- Create the ability to add new data to your member pages:
- Add a JavaScript function to check for errors
- Start an ASP code section
- Remember "on error resume next" should be the first line of ASP
- Add a variable for filename & map the server path
- Create the database connection object
- Set the connection provider
- Open the database
- Check for errors
- Set the recordset
- Create a variable for sql & SELECT WHERE id = id
- Open the recordset using the sql
- If any records are returned, tell the user that that particular ID has been used & request the user pick another ID
- If no records are returned, continue to add the user data to the database table
- Create variables for the six (6) database table fields & request.form() to assign value
- Use the variable sql & build it based on standard SQL INSERT
- Response.write() the sql variable
- Execute the connection
- Check for errors
- Display a message to the user how many records affected
- Close the connection
- Add a command button for back
- Add a command button to close the window
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 33 |
05/23/07 |
|
Wednesday - Career & ASP ADO |
|
- Classroom Discussion -
- Career - Interview Practice for this job - Read the add & be prepared for a practice interview
- ADO - w3schools.com - Update
- Lab Assignment -
- Create the ability to add new data to your member pages:
- Use the w3schools.com page for ideas
- Add a form method "post" action "memberUpdate.asp"
- Display all existing records each with a command button to update
- When the user clicks one of the buttons, submit & load a new web page "memberUpdate2.asp"
- Add a form method "post" action "memberUpdate2.asp"
- Connect to the database
- Check for errors
- Retrieve one recordset by id match
- Check for errors
- Display the recordset field values in text fields to allow the user modify the data in the four (4) updatable fields:
- fName
- lName
- city
- eMail
- Add a cancel command button to link back to the "memberDisplay.asp" page
- Add a submit command button to allow the user so update the data
- Connect to the database
- Check for errors
- Add variables for the four (4) updatable fields & assign values using "request.form()":
- fName
- lName
- city
- eMail
- Add a variable "sql" & build the value for the SQL UPDATE command using the four (4) field variables
- Execute the sql variable getting "recaffected"
- Check for errors
- Tell the user how many records affected
- Add a done command button to link back to the "memberDisplay.asp" page
- Add a close command button to close the window
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
| 34 |
05/24/07 |
|
Thursday - Math & ASP ADO |
|
|
|
| 35 |
05/25/07 |
|
Friday - SkillsUSA PDP & ASP ADO |
|
- Classroom Discussion -
- ADO Quiz 1 - Print for your records (in case the database fails)
- ADO - w3schools.com - Stream
- ADO - w3schools.com - Summary
- Lab Assignment -
- Create a web page "memberIndex.asp" to link all of your member pages together:
- Add a way to link to "memberDisplay.asp"
- Add a way to link to "memberInsert.asp"
- "memberUpdate.asp" is linked through the display pages so you don't need a link to update
- Test everything: all links, all text fields, all command buttons
- Make your web pages look good
- Save to "inetpub/wwwroot/css##/" to test
- Copy to your "myDocuments"
- Copy to your "H:/asp/" folder
- Copy to your "H:/toBeGraded/" folder
- Marking Period 4 Project
|
|
|
05/28/07 |
|
Monday - OCVTS School Closed - Memorial Day Holiday
US Memorial Day.org
|
For love of country
they accepted death
~ James A. Garfield
|
|
|
| 36 |
05/29/07 |
|
Tuesday - Science & XML |
|
|
| 37 |
05/30/07 |
|
Wednesday - Career & XML |
|
- Classroom Discussion -
- Career - Interview Practice for this job - Read the add & be prepared for a practice interview
- XML - w3schools.com - Validation
- XML - w3schools.com - Validator
- XML - w3schools.com - Browsers
- XML - w3schools.com - Viewing
- Evaluation of Marking Period 4 Projects - making sure they work by trying to break them
- Lab Assignment -
- Modify "Kelsey's" breakfast menu to be XML compliant:
- When you place ASP with database file onto "toBeGraded":
- Change server.MapPath("member.mdb") to server.MapPath("../member.mdb")
- Remove "member.mdb" from "toBeGraded"
- Marking Period 4 Project
|
| 38 |
05/31/07 |
|
Thursday - (English or Math) & XML |
|
- Classroom Discussion -
- XML - w3schools.com - CSS
- XML - w3schools.com - XSL
- Evaluation of Marking Period 4 Projects - making sure they work by trying to break them
- Lab Assignment -
- Modify Kelseys.xml to use "xsl" style sheet:
- Add this line as line 2 in "breakfast.xml":
<?xml-stylesheet type="text/xsl" href="kelseys.xsl" ?>
- Create a new page named "kelseys.xsl"
- Erase any existing code
- Add code to the top for "xml version" & "html xsl:version" & setup the "body" of the page:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<head><title>Kelsey's Breakfast Menu</title></head>
<body style="font-family:Arial,helvetica,sans-serif;font-size:12pt;
background-color:#EEEEEE;background-image:url('tan.jpg')">
- Center the Kelsey's Diner image at the top & list the times breakfast is served:
<div style="text-align:center">
<img src="breakfst.jpg" />
<h3>Breakfast Served 6:30 a.m. - 11:00 a.m.</h3>
</div>
- Create an xsl loop for each menu item:
<xsl:for-each select="menu/item">
- Display the name bolded & price as white on teal background:
<div style="background-color:green;color:white;padding:4px">
<span style="font-weight:bold;color:white">
<xsl:value-of select="name" />
</span>
- <xsl:value-of select="price" />
</div>
- Display the description smaller letters:
<div style="margin-left:20px;margin-bottom:1em;font-size:10pt">
<xsl:value-of select="desc" />
</div>
- End the xml loop, end the body, end the html:
</xsl:for-each>
</body>
</html>
- Test & correct any errors
- - Modify the lunch & dinner menus to be XSL compliant also
- When you place ASP with database file onto "toBeGraded":
- Change server.MapPath("member.mdb") to server.MapPath("../member.mdb")
- Remove "member.mdb" from "toBeGraded"
- Marking Period 4 Project
|
| 39 |
06/01/07 |
|
Friday - XML |
|
- Classroom Discussion -
- XML - w3schools.com - Data Island
- XML - w3schools.com - Applications Demo
- XML - w3schools.com - Editors
- XML - w3schools.com - Summary
- Evaluation of Marking Period 4 Projects - making sure they work by trying to break them
- Lab Assignment -
- Sample XML Data Islands in a table from w3schools.com
- Sample XML Data Islands with [next] & [previous] command buttons from devGuru.com
- When you place ASP with database file onto "toBeGraded":
- Change server.MapPath("member.mdb") to server.MapPath("../member.mdb")
- Remove "member.mdb" from "toBeGraded"
- Marking Period 4 Project
|
|
| 40 |
06/04/07 |
|
Monday - XHTML |
|
- Classroom Discussion -
- XHTML - w3schools.com - Intro
- XHTML - w3schools.com - Why
- XHTML - w3schools.com - vs. HTML
- Lab Assignment -
- Web Completer Exam - This is your final exam - Print for your records (in case the database fails)
- When you place ASP with database file onto "toBeGraded":
- Change server.MapPath("member.mdb") to server.MapPath("../member.mdb")
- Remove "member.mdb" from "toBeGraded"
- Marking Period 4 Project
|
| 41 |
06/05/07 |
|
Tuesday - XHTML |
|
- Classroom Discussion -
- XHTML - w3schools.com - Syntax
- XHTML - w3schools.com - DTD
- Lab Assignment -
- Web Completer Exam - This is your final exam - Print for your records (in case the database fails)
- When you place ASP with database file onto "toBeGraded":
- Change server.MapPath("member.mdb") to server.MapPath("../member.mdb")
- Remove "member.mdb" from "toBeGraded"
- Marking Period 4 Project
|
| 42 |
06/06/07 |
|
Wednesday - XHTML |
|
- Classroom Discussion -
- XHTML - w3schools.com - How To
- XHTML - w3schools.com - Validation
- Lab Assignment -
- Web Completer Exam - This is your final exam - Print for your records (in case the database fails)
- When you place ASP with database file onto "toBeGraded":
- Change server.MapPath("member.mdb") to server.MapPath("../member.mdb")
- Remove "member.mdb" from "toBeGraded"
- Marking Period 4 Project
|
| 43 |
06/07/07 |
|
Thursday - XHTML |
|
- Classroom Discussion -
- XHTML - w3schools.com - Modules
- XHTML - w3schools.com - Attributes
- Lab Assignment -
- Web Completer Exam - This is your final exam - Print for your records (in case the database fails)
- When you place ASP with database file onto "toBeGraded":
- Change server.MapPath("member.mdb") to server.MapPath("../member.mdb")
- Remove "member.mdb" from "toBeGraded"
- Marking Period 4 Project
|
| 44 |
06/08/07 |
|
Friday - XHTML - Last Day - Toms River |
|
- Classroom Discussion -
- XHTML - w3schools.com - Events
- XHTML - w3schools.com - Summary
- Lab Assignment -
- Web Completer Exam - This is your final exam - Print for your records (in case the database fails)
- When you place ASP with database file onto "toBeGraded":
- Change server.MapPath("member.mdb") to server.MapPath("../member.mdb")
- Remove "member.mdb" from "toBeGraded"
- Marking Period 4 Project
|
|
| 45 |
06/11/07 |
|
Monday - Last Day - Brick, Point Beach |
|
- Classroom Discussion -
- Lab Assignment -
|
| 46 |
06/12/07 |
|
Tuesday - Last Day - Lacey, Lakewood, no Jackson PM, no Manchester AM, Pinelands, Point Boro, Southern (PM) |
|
- Classroom Discussion -
- Lab Assignment -
|
| 47 |
06/13/07 |
|
Wednesday - Last Day - no Jackson AM, New Egypt, Point Boro, Southern (AM) |
|
- Classroom Discussion -
- Lab Assignment -
|
| 48 |
06/14/07 |
|
Thursday - Last Day - no Jackson PM |
|
- Classroom Discussion -
- Lab Assignment -
|
| 49 |
06/15/07 |
|
Friday - Last Day - Central, no Jackson AM |
|
- Classroom Discussion -
- Lab Assignment -
|
|
| 50 |
06/18/07 |
|
Monday - Certificate Ceremony - Last Day - OCVTS, Barnegat |
|
- Classroom Discussion -
- Lab Assignment -
|