 |
|
CS 130A Information
This page contains information for students enrolled in CS 130A, section
010, for the Fall 2004 semester.
Course Information
More information will be posted as the semester progresses. CS 130A
students are encouraged to bookmark this page and check often.
Absence Thu 10/22. Because there was no class on Thu, 10/21, we're
going to push a few things back:
- Assignment 6 is now due on Tue, 10/26
- Midterm 2 will now be on Tue, Nov 2
- We will finish our discussion of creating a web log on Tuesday, 10/26
and have a midterm review on Thursday, 10/28. We will also start talking
about regular expressions on Thursday, 10/28.
- New! Assignment 7 will be distributed on
Tuesday, November 9, and be due Tuesday November 16. Assignment 8 will be
handed out Noveber 18 per the original schedule.
Examples
- Dec 2, Dec 7
- Several pages that use HTTP headers:
- This
page uses Location to do a redirection.
See the results here
- This
page specifies another content-type
See the results here
- This
page specifies another content-type, and a download.
See the results here
- Several pages that use cookies and sessions:
- This
page and this
page use a cookie to set a user-defined background color.
See the results here
- Here are several pages that use session variables:
You can watch them work by starting here
- November 29
- Today we looked at changing data in our database.
- November 23
- Today we look at aggregate functions. Look at the following:
- This
page uses PHP code to get the average price of an item in our inventory.
See the results here
- This
page uses an SQL aggregate function to get the same result.
See the results here
- This
page uses an SQL aggregate function with a GROUP BY clause.
See the results here
- November 16-18
- Today we looked at several variations on a page that selected data
from a MySQL database
- This
page displayed these simple results.
See the results here
- This
page displayed the same results, sorted.
See the results here
- This
page displayed the same results, for those customers that live in
Minnesota.
See the results here
- This
page displays results from two tables.
See the results here
- This
page and
this
page work together to show the same results, for a user-selected subset of
data.
See the results here
- November 11
- Today we will discuss email. Here is the source of the pages we
discussed:
- November 9
- Today we looked at several pages that worked with this data file.
- This
page displays the contents of the file in a table. See the results
here
- This
page displays a selection list of classes. It then links to
this
file to display the appropriate parts of the schedule. See this set of
pages in action
here
- For Part I of Assignment 7, you will need to work with this data file. It is the same as the data file used on
Tuesday.
- For Part II of Assignment 7, you will need to work with this data file. It is similar to the data file used
earlier in the week, but it has an extra column of data. In Part II, you will
create a page that will generate a table like this.
- Oct 27
- Use this page to try out regular
expressions in PHP.
- Web Log
- This week we worked on creating a web log. There are a few source
code files we developed:
To try this out, start here.
- October 14
- This page
demonstrates more file input. Here is
the file that it reads as input (and which you'll need to work with for
Assignment 6).
Try it here.
We'll look at a modified file in class -- here's the source,
and here's it in action.
- This page
demonstrates another file system function, is_readable.
Try it here.
- This page has a form that
contains a file input element, used to upload files to the server.
It is processed by this page. The
file that is uploaded is displayed by this page -- see it in action
here.
- Oct 12
- This page
demonstrates some simple file input.
Try it here.
- This page
demonstrates more file input.
Try it here.
- This page
demonstrates how, if we put our test for end of file
in the wrong place, we can get an extra line of
output.
Try it here.
- Oct 7
- Homework files -- Here are the forms you will need for Part I and Part II of
Assignment 5.
- This page uses
a user-defined function to help do some sorting.
Try it here.
- This page
demonstrates the difference between pass-by-value and pass-by-reference.
Try it here.
- Oct 5
- User-defined functions
- This page uses
a simple user-defined function.
Try it here.
- This page uses
a slightly more complicated user-defined function.
Try it here.
- This page uses
an even more complicated user-defined function.
Try it here (notice the use of a
querystring in this URL).
- Sep 30 More fun with arrays and loops
- This page processes
this form
to get a multiplication table. Note the use of nested loops!
Try it here.
- This page processes
this form
to divide up some text into words.
Try it here.
- This page processes
this form
to count up the number of words of different lengths.
Try it here.
- In assignment 4, you will need to write a page that will create a
color table that looks something like this.
- Sep 28
- Associative arrays
- This page displays the
page shown here.
- This page processes
this form. Try
it here.
- This page processes
this form (with a
multiple selection list!). Try it here.
- Sep 16
- Sample Problems
- Problem 1 -- This page calculates the deduction from this form.
- Problem 2 -- This page displays the
temperature chart shown here.
- Sep 14
- Today we will discuss arrays.
- This page uses
a for loop to display a list of foods. You can see the results here.
- This page uses
a foreach loop instead. You can see the results here.
- This page uses
a for loop to create an order form. The order form is processed by
this page.
You can see the form in action here.
- Sep 9
- Today we will finish our loop discussion. Here's our last example:
- We also talked about more complicated forms, such as this one. This page will show
what we get from that form
- Sep 7
- Today we will discuss loops. I have a few examples:
- Sep 2
- Today we will discuss conditional statements. This page
uses a simple conditional statement to calculate overtime. It processes
this form.
- Aug 31
- Here's the
example
from today's class. You can see the source code for this page here.
- Week of Aug 23rd
- Here's an example of a simple PHP
page.
- Here's an example of a simple form
that can be processed with PHP.
Here is the
source of the PHP page that processes that form.
Resources
HTML. If you need to brush up on your HTML, check out the W3Schools
Editors. Here are some resources for text editors:
- Interested in using vi? Read here
for more information about using vi. It's a steep learning curve, but it's worth it!
- Want to use vi on a Windows or Mac machine? Check out VIM
(vi Improved). (note: this site is a PHP site)
- Alternatively, PC users might want to try Ultra-Edit,
while Mac users might want to try BBEdit
PHP on your own machine. Interested in getting PHP installed locally? Look here:
- First off, look at the Main PHP web site. PC users -- take a look
at the downloads section.
- OS X users, you've got it easy -- PHP is already installed, you just need to activate it. Take a
look at this article to see how.
Last modified Oct 12, 2004
|