lis-458-ol-php/instructions.txt

39 lines
3.3 KiB
Plaintext
Raw Permalink Normal View History

2018-02-18 01:30:12 +00:00
Modifying PHP code to communicate with your database
(1). Please download Lab10.zip from Moodle, and unzip the files onto your computer. You will see multiple HTML files, css files and php files in the folder.
(2). You will see the following pages:
a. mysqli_connect.php: makes connection to the database account. Pages that will communicate with your MySQL database will need to use this file in order to connect.
b. index.php: the main page of the website
c. grade.php: retrieve course grade information for a student.
d. employee.php: insert a new lecturer into the database.
e. search.php: search lecturers and students by names
f. ClassRoster.php: retrieve the class roster for a specific course
g. The includes folder:
i. header.html: the header (log, navigation bar, etc.) section of each page on this website
ii. footer.html: the footer section of each page on this website
iii. style.css: the overall style of the website.
Please note that there are detailed comments in each php page. Make sure you read them carefully and understand what each proportion of PHP does.
(3). Please open the mysqli_connect.php file using a text editor. If you are on Windows, you can use Komodo Edit, Notepad++, PHP Storm, Eclipse, etc. If you are on Mac, you can use TextWrangler, Komodo Edit, Eclipse, etc. In the editor window, please modify the code accordingly so that the connection will be made to your own database on simmons server.
(4). Please upload all the files (but this word document) to LIS458 folder that you created under public_html. Make sure the folder called “include” is also moved to LIS458.
(5). Open a browser and type the following information to the address bar:
web.simmons.edu/~your username/LIS458/index.php
You should see the following page in the browser. Click the navigation section and take a look at each page.
(6). Please do the following task on each page:
a) On ClassRoster Page, please search the class roster information for “Computer Networks”. What does it return? Take a screenshot of the result and paste it below.
b) On New Employee Register page, insert a new lecturer with last name=”Smith”, first name=”Cecilia”, email=cecilia@test.com, gender=”female” and ssn=”1243568790”. What is the message returned? Take a screenshot and paste it below.
c) On the Course Grade page, please search for course grade for a student with last name=”Mcneil”. Take a screenshot of the returned result and paste it below.
d) On the Search People page, please search for a student with first name=” Irene”. Take a screenshot for the result and paste it below. Then search for a lecturer with last name=”Lowe”. Paste the result below.
(7). Please modify the search people page, so that you can search by lecturer last name or lecturer email address. Make sure you upload the modified search.php code onto Simmons server to overwrite the original one. Then you can search from your browser to see if the change works.
(8). Please modify the Class Roster page so that it allows search by Course Name and Semester Information. Please provide a list of semesters for users to select from (recall drop-down menu from the first lab). Similarly, upload the modified page to Simmons server and revisit it from your browser.