Docsity

Database and PHP Exercise - Web Technologies | Assignment 5 | CSCI 4410, Study notes of Computer Science

Toggle sidebar
bg1
4410/5410 Web Technologies Assignment 5 Spring 2012
Due April 17 (Tuesday night)
Purpose: Database and PHP exercise
Assume that the database for the assignment 4 has been created on a server.
You will be creating a XHTML file and a PHP file to use the database.
Constraints: The PHP file should include the include.php which contains only the assignments
of following database related variables: $dbhost, $dbuser, $dbpass, and $dbname. IMPORTANT:
You should use the above names in your PHP file, otherwise your code will not work when I grade
yours assignment. Following is a sample include.php file:
<? // include.php example
$dbhost = 'mysql.cs.mtsu.edu'; // mysql server
$dbuser = 'c13606XY';
$dbpass = 'password';
$dbname = 'c13606XY';
?>
The XHTML file should
1. contain a form with a dropdown list of three table names (agencies, agents, and listings) along
with [show] button. This form should have a sub-heading that explains what it does.
2. contain a form with 2 text input values: 1) for the minimum square footage of the house and 2)
for the maximum asking price. The two text box should be properly labeled so that the user
understands the purpose. There should be a [search] button that initiates an appropriate action.
This part should have the second sub-heading “Find houses”.
The above text input should be checked for an appropriate value such as positive integer values
using JavaScript functions. If invalid values are filled an alert message should be provided.
The PHP file should handle the submitted forms from the XHTML file in the following way:
1. If a user clicked on the [show] button, send an appropriate query to the server and display the
results in a table form with the field names as headings to the table. Assume that you don’t
know the column (field) names that are returned from the query.
2. If a user clicked on the [search] button, send an appropriate query to the server and display
following information in a table format: ListingNo, SqFt, BR, Bath, Asking, Agent’s last name
with the phone number.
Each page displayed in the browser should have a heading and the title that specifies the
assignment number and your name.
Include comments in all files identifying your name, the file name, and the assignment number.
All codes should be reasonably commented so that it explains each part.
To turn in this assignment, create a zipped folder that contains all the related files. Submit
this zipped folder on D2L (elearn.mtsu.edu) in the dropbox for assignment 5.

Partial preview of the text

Download Database and PHP Exercise - Web Technologies | Assignment 5 | CSCI 4410 and more Study notes Computer Science in PDF only on Docsity!

4410/5410 Web Technologies Assignment 5 Spring 2012

Due April 17 (Tuesday night)

Purpose : Database and PHP exercise

Assume that the database for the assignment 4 has been created on a server. You will be creating a XHTML file and a PHP file to use the database.

Constraints : The PHP file should include the include.php which contains only the assignments of following database related variables: $dbhost, $dbuser, $dbpass, and $dbname. IMPORTANT: You should use the above names in your PHP file, otherwise your code will not work when I grade yours assignment. Following is a sample include.php file:

 The XHTML file should

  1. contain a form with a dropdown list of three table names (agencies, agents, and listings) along with [ show ] button. This form should have a sub-heading that explains what it does.
  2. contain a form with 2 text input values: 1) for the minimum square footage of the house and 2) for the maximum asking price. The two text box should be properly labeled so that the user understands the purpose. There should be a [ search ] button that initiates an appropriate action. This part should have the second sub-heading “Find houses”. The above text input should be checked for an appropriate value such as positive integer values using JavaScript functions. If invalid values are filled an alert message should be provided.

 The PHP file should handle the submitted forms from the XHTML file in the following way:

  1. If a user clicked on the [show] button, send an appropriate query to the server and display the results in a table form with the field names as headings to the table. Assume that you don’t know the column (field) names that are returned from the query.
  2. If a user clicked on the [search] button, send an appropriate query to the server and display following information in a table format: ListingNo, SqFt, BR, Bath, Asking, Agent’s last name with the phone number.

 Each page displayed in the browser should have a heading and the title that specifies the assignment number and your name.  Include comments in all files identifying your name, the file name, and the assignment number. All codes should be reasonably commented so that it explains each part.

To turn in this assignment, create a zipped folder that contains all the related files. Submit this zipped folder on D2L (elearn.mtsu.edu) in the dropbox for assignment 5.