The table below lists the topics and resources used in class to help you study for Test 2. I have posted last year's quizzes along with answer sheets. You can find them at the following links:
I've also posted this year's PHP quiz with answers:
As discussed in class, the format of the test will be part written and part programming. The written part will be completed first. As soon as you have turned in the written section, you will be allowed to log in to your PC and begin the programming portion of the test. The programming portion will contain two parts: a debugging exercise and a short programming or debugging exercise. During the programming portion, you will only be allowed to program using one of the development applications and access our course website or the manual found on php.net. There will be no searching on Google, etc.
Topic | Notes/Lab Exercises | Comments |
Intro to PHP | Details: In this introduction to PHP we covered the differences between server-side and client-side operation, the format of a PHP file, the syntax of PHP code and similarities between PHP code and JavaScript code, data types, and data type conversion, i.e., what happens when a value of one type is converted to another. We also compared and contrasted echo and print, discussed character escaping for specific characters using a backslash, '\', and printing characters not available on the keyboard using "\x". Be sure to study the material in the lab on creating functions and including files in PHP. Cheat sheet: There really isn't much to offer in the way of syntax here. If I am going to ask you to use a predefined function such as pow(), I will give you the syntax with the problem. You should probably already be familiar with the syntax of the program constructs such as if-statements, while-loops, switch-case-blocks, etc. |
|
Arrays & strings in PHP |
|
Details: Material you will be responsible for in this section includes variable scope, global variables, static variables, arrays, and strings. When it comes to arrays, be sure you know the special indexing needs and the use of foreach. Be sure to look over the array and string functions, but if I ask a question regarding one of the functions, I will give you the syntax with the problem. Cheat sheet: The following syntax will be included on your cheat sheet. For the functions included in this list, be sure you know how the function operates.
|
Using forms to pass data to PHP |
|
Details: Understand the difference between post and get and how to use $_GET and $_POST arrays to retrieve form data. Cheat Sheet: There really isn't anything to add to the cheat sheet from this section. |
Accessing MySQL through PHP | Details: Understand the process of accessing a MySQL database using PHP. This includes the PHP functions that allow us to:
Cheat sheet: The following syntax will be available on your test. Be sure you understand how to use them.
|
|
Objects | Be able to define and use objects. This includes the use of the "new" operator and the "->" operator. There will be no specific questions on PEAR. PEAR was used as a method for showing how instances of objects were used. |
Prepared by David L. Tarnoff for the sections of CSCI 2910 at ETSU