Due: see class web page
In a UNIX window running on lab0z: ssh -X holland (and login with your Emory NetID passwd) |
To verify that you have copied the file php-form.html correctly, type the following URL in a web browser (firefox, IE, Safari, ...) (on your laptop or on a lab machine):
http://holland.mathcs.emory.edu/~Your-NetID/php-form.html |
You should see the following form with the title CS377 PHP project :
![]() |
You can login to holland.mathcs.emory.edu with this command from any lab machine or from lab0z.mathcs.emory.edu:
ssh -X holland (enter your Emory NetID passwd) On holland: cd public_html (You will be working in this directory to do the PHP project) |
The assignment consists of 2 parts:
|
The user can make queries on the spjDB database by entering one or more values for supplier name, supplier city, part name, part city, project name and/or project city:
![]() |
and then click Submit Query to send the 6 input fields to the web server.
In response, the web server will execute the PHP program (describe in step 2) and retrieve all shipment information that matches the input field criterias.
Examples:
|
Furthermore, the input must allow for UNIX style wildcards:
Example:
|
Supplier Name | Supplier City | Part Name | Part City | Project Name | Project City | Quantity Shipped |
---|---|---|---|---|---|---|
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
The other attributes must not be listed
The header (first row containing the attribute names) must have a different background color from the data rows.
Instead, run the PHP program as a stand-alone PHP program that you execute with a line command
To test your CS377 project, use the following command on holland:
If you haven't done so: go to your public_html directory: cd ~/public_html |
/home/cs377001/bin/test-php PHPProj.php Lofton "" "" "" "" "" (Should get all shipment for supplier Loftus) (An empty field is denoted by "") |
The /home/cs377001/bin/test-php command will initialize all 6 variables in the form (see the content of the webpage file) before it execute your PHP program
But at least you will have more information when the program crashes (in a webpage version, you get a blank webpage when your program crashes)
|
<?php $x = "Hello World"; print $x."\n"; for ( $i = 0; $i < strlen($x); $i++ ) { if ( $x[$i] == 'o' ) $x[$i] = 'u'; } print $x."\n"; ?> |
In fact, if every field in the webpage form is empty, the query must retrieve all shipment tuples !!!
|
Solution:
|
/home/cs377001/turnin Your-PHP-program.php php |
Note:
|
If you have the final version of your code on holland.mathcs.emory.edu, you must transfer the PHP program from holland.mathcs.emory.edu to a lab machine using the following command:
On holland.mathcs.emory.edu: Transfer your PHP prog to lab0z using these commands: 1. cd ~/public_html 2. scp your-PHP-prog.php lab0z:~/cs377 (Enter your Emory NetID passwd) |
Extension request
/home/cs377001/req-ext php |
You request will be successful if you have not exceeded the maximum number of "free" (no-questions-asked) requests allowed