Uploaded by 571722 Riley Coates - Student

Stuvia-442363-btec-level-3-unit-27-web-server-scripting-a2

advertisement
BTEC LEVEL 3 - Unit 27- Web Server
Scripting A2
written by
OllieJ10
www.stuvia.co.uk
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
Browser Recognition & Screen Resolution- P2
The footer includes social links and links to tools.
This icon links to the browser/resolution display page.
This pages shows the user the current browser they are using as well the resolution
of their monitor.
This php code finds the information about a users resolution/browser.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This code displays the information about a users resolution/browser.
Uploading A File To A Web Server- P3
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
Screenshots Of File Being Uploaded
This is the profile page where images can be selected and uploaded.
This is the empty upload folder.
This is the upload folder after an image has been uploaded.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This code allows the user to select an image.
This code uploads the selected image to the uploads folder as long as the image meets the
requirements.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
Implement, Test & Document A Simple Login System- P4
Statement Of Need
A simple login system like the one I implemented into my website would be useful in a wide
range of scenarios in which website developers or owners want access to a certain part of a
website which they do not want others to have access to.
For example if a website developer wanted easy access statistic information he may place a
link to view such information on the website itself however have a simple login system
implemented onto the landing page of the linked website so that only people who have the
correct login credentials would be able to view the statistic information.
Screenshots Of Incorporated Simple Login System
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This image shows the login screen.
This image shows the session screen which appears after a correct login is entered.
This image shows the login screen after an unsuccessful login attempt.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This code takes the user to the protected.php page if the correct login credentials are
inputted.
This is the code for the protected.php page.
This is the code which allows the user to logout when the logout button is pressed.
Testing Tables
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
Black Box Testing
Test Results
Test Results (Actual)
(Expected)
Test description
Does the login page
display the correct
information?
Does the login page
load the protected
page if the login
information is
correct?
The login page will
display the correct
information.
The protected page
will load if the
correct information is
inputted.
Does the login page
output an error if the
information inputted
is wrong?
The login page will
output a message
telling the user that
the information they
inputted is wrong.
The login page will
load after the logout
button is pressed.
Is the user redirected
to the login page
once the logout
button is pressed?
Fix
The login page displayed
the correct information.
No fix required.
The login php was failing to
connect to the database on
sql due to incorrect
information therefore the
php did not know what the
correct login credentials
were.
I corrected the information so
that the php was able to
connect to the database
where login credentials were
kept, after this the protected
page was loaded after the
correct credentials were
inputted.
No fix required.
The correct message was
outputted.
The logout php was linking
to the wrong page and
instead loading the
protected page.
I changed what page the
logout php was linking to and
this fixed the issue.
White Box Testing
Item to improve
Suggestion
How
The login page.
There could be an option added on to
the page which acts as a hint towards a
password or a way to reset a password.
By adding hint towards the password on the
login page which shows up when the user
clicks on a “forgotten password button”.
The protected
page.
The protected page is not formatted like
the rest of the website meaning that the
links to other pages are not available on
the page, therefore it would be better if it
was formatted like the other pages.
By adding the same lines of code which are
included on the other pages of the login
system.
The logout
button.
The php for the logout button is currently
stored in a separate php file to the
protected file however it would be
simpler to have the php code for the
button situated in with the protected file
code.
By moving the code for the logout button
from logout.php to protected.php.
Implement, Test & Document A Guest Book- P5
Statement Of Need
A guest book system like the one I implemented into my website would be useful in a wide
range of scenarios in which a user wants to leave a review or comment about a specific
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
website. This is because both users and website owners would be able to view the
messages.
For example hotel websites may want a guest book system in place so that visitors are able
to leave positive reviews which will inturn attract more customers or because they may want
to use the customers feedback to make improvements to their business. Such a system
would also be a way to get in contact with members of staff from the hotel so it could also be
used as a way for customers to ask any questions about the hotel they may have.
Screenshots Of Incorporated Guest Book
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
The contact page above allows users to leave messages.
The footer includes social links and links to tools
This icon links to the guest book messages display page.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This page displays all messages previously left by users.
This code allows for new information to be inputted.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This code adds the inputted information into the gbook database.
This code displays the information from the gbook database.
Testing Tables
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
Black Box Testing
Test Results
Test Results (Actual)
(Expected)
Test description
Does the guest book
page connect to the
guest book
database?
The guest book will
connect to the guest
book database.
Does the guest book
input page display the
correct information?
Does the guest book
display page show
the correct
information?
Does the database
update when new
information is added
via the guest book
input page?
The guest book will
display the correct
information.
The display page will
show all of the
information from the
guest book correctly.
The database will
update when new
information is added.
The guest book page was
not able to connect to the
guest book database due
to incorrect login
information for the
database.
The guest book displayed
the correct information.
Fix
I changed the user
credentials for the database
in the code so that they were
correct.
No fix required.
The correct information
was outputted.
Due to an error with the
data type chose to validate
the message information
none of the messages
were being accepted by
the database.
No fix required.
I had to change the message
data type to be text instead of
int.
White Box Testing
Item to improve
Suggestion
How
The guest book
page.
Give the user an option to ask for help
and tips.
By including a button which when pressed
displays information about what relevant
information the user should input.
The guest book
display page.
Display more information about the
message.
By displaying the date and time at which the
message was created.
The guest book
database.
Make it easier to sort through the guest
book databases messages.
By including an ID with every message
which is unique it means that messages can
easily be sorted through quicker.
Upload & Edit The Content Of A File- M2
Screenshots Of Changes To File
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This is the empty file where the data from the form is saved.
The profile page is where the information is inputted.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This is the profile page after the information has been saved.
This is the file after the information has been inputted.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This is the code on profile.html which allows the user to input information.
This code adds the inputted information to the data file and displays that information onto the
page.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This code allows for the data in the file to be edited and then outputs the edited data.
Implement, Test & Document A Dynamic Login System- M3
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
Statement Of Need
A dynamic login system like the one I implemented into my website would be useful in a
wide range of scenarios including ones where websites have a requirement to store
information about a user and want that information be secure and accessible to the user
only.
For example on forums there is a need to identify who people are by using usernames, for
these usernames to be created a user must first create an account and this account would
be required to have a password connected to it, the username and password for this account
would then be stored in a database.
Screenshots Of Incorporated Dynamic Login System
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This is the dynamic login page.
This screen is shown after the correct login details are inputted.
This is the user creation page which adds new users to the user database when information
is inputted.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
After user details are inputted on the creation page this page is displayed.
This is the code for the login page which links to the login database to check to see if the
users details are correct.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This is the code for the protected page which links to the create a user page.
This is the code for the create a user page where new user credentials can be inputted.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This code adds the inputted information into the login database and then asks the user
whether they want to logout or create another user.
Testing Tables
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
Black Box Testing
Test Results
Test Results
(Expected)
(Actual)
Test description
Does the login page
display the correct
information?
Does the login page
connect to the login
database?
The login page will
display the correct
information.
The login page will
connect to the
database.
The login page
displayed the correct
information.
The login page could
not connect to the
database.
Can users
successfully be
created?
Users will be created
when new login
information is
inputted.
The login page will
output a message
telling the user that
the information they
inputted is wrong.
Users details were
not added to the
database.
Does the login page
output an error if the
information inputted
is wrong?
The correct message
was outputted.
Fix
No fix required.
I was using a new version of php
which was not compatible with “sql
connect” which was a line of code i
was trying to use to connect to the
database, to fix this i had to
downgrade my php version.
I had to change the login information
for the database in the code so that
when logged in the user had
permissions to add to the database.
No fix required.
White Box Testing
Item to improve
Suggestion
How
User creation
database.
To avoid errors from occuring the
usernames of users should all be
unique.
By going to the creation database and
applying the primary key identifier to the
username column
The protected
page.
The protected page is not formatted like
the rest of the website meaning that the
links to other pages are not available on
the page, therefore it would be better if it
was formatted like the other pages.
By adding the same lines of code which are
included on the other pages of the login
system.
The login page.
There could be an option added on to
the page which acts as a hint towards a
password or a way to reset a password.
By adding hint towards the password on the
login page which shows up when the user
clicks on a “forgotten password button”.
Implement, Test & Document An Error Log- M4
Statement Of Need
An error log system like the one I implemented into my website would be useful in a wide
range of scenarios in which a user wants to try a troubleshoot an error they are having with a
specific website, the information stored could also be useful to website developers as they
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
may be able to use the information to identify errors which are the fault of the server.
For example if a user’s browser crashes every time they open a specific website, by looking
at the error log for the website it may be possible to identify whatever issue was causing the
crashing to occur and then fix said issue.
Screenshots Of Incorporated Error Log
If errors are found they are displayed at the top of the index.php page.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This error shows when the About.html page cannot be found.
This is the entry in the errors log for the above error.
This is the code on the index.php page which searches for the about.html page and then
outputs an error if it is not found, this error is then added into the errors log.
Testing Tables
Black Box Testing
Test Results
Test Results (Actual)
(Expected)
Test description
Do the errors display
the correct
The errors will
display the correct
The errors displayed the
correct information.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Fix
No fix required.
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
information?
Does the error log
update with new
entries when errors
occur?
information.
The error log will
update with new
entries when errors
occur.
Are the entries in the
error log displaying
the correct
information?
The entries in the
error log will display
the correct
information.
The code on the index.php
page was not properly
linked to the error log
meaning the entries were
not being added.
The time of which the
errors were supposed to
have occured was incorrect
by one hour.
I had to correctly link code on
the index.php page to the
error log file..
I had to change the code so
that the date and time was
decided by “DATE_RSS”.
White Box Testing
Item to improve
Suggestion
How
The error display
notification.
Include more details in the error
message about the specific problem
including how to fix the problem.
By adding to the code on the index.php page
which displays the error.
The error log.
Including information about the user in
the error log, so that it is easier to
troubleshoot a problem.
By including information about the users
browser and the usage statistics of the users
computer.
The Generation Of Statistics- D2
Screenshots Of Generated Statistics
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
The footer includes social links and links to tools.
This icon links to the web statistics page.
This is a list of users who have viewed the index.php page.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Stuvia.co.uk - The Marketplace for Revision Notes & Study Guides
This code gets the user information of whoever loads the page and saves that information in
the “webstats” database.
This code pulls all the data from the “webstats” database and puts it into a table.
Downloaded by: 571722rileycoates-student | 571722@students.gateshead.ac.uk
Distribution of this document is illegal
Powered by TCPDF (www.tcpdf.org)
Download