Chat with us, powered by LiveChat CISM 4157 ASSIGNMENT 4 CH 12 | Writedemy

CISM 4157 ASSIGNMENT 4 CH 12

CISM 4157 ASSIGNMENT 4 CH 12

Question

CISM 4157 – Assignment 4

Chapter 12 – Error Handling and Validation

Instructions: Update the PHP file (i.e. ROakley_A4.php) so that it accomplishes all steps. Submit the PHP file

and the 3 screenshots of the form in D2L in the Assignment 4 Dropbox.

PHP section

1. Create the following variables to store error messages. Set all variables equal to an empty string. Set

siteError equal to (zero) 0.

Variable names

nameError name

commentError email

emailError comment

statusError status

siteError

2. Write PHP code that will check to see if the request method used is POST. If that is true, then the user

has submitted data that needs to be validated.

3. Write the PHP code to check the name field. If it is empty, set name variable to “Full Name is Required”

& set siteError variable to 1. If the name field is not empty, set the name variable to the data the user

entered then validate that it is in the proper format. Set nameError variable to “Only letters and white

spaces allowed” if it is not in the proper format.

(HINT: the data the user entered is store in $_POST[“fieldname”] where fieldname is the field of

interest.)

4. Write the PHP code to check the email field. If it is empty, set email variable to “Email is Required”

& set siteError variable to 1. If the email field is not empty, set the email variable to the data the user

entered then validate that it is in the proper format. Set emailError variable to “Invalid email format” if

it is not in the proper format.

5. Write the PHP code to check the comment field. If the comment field is empty, set commentError

variable to “Comment to Advisor is Required” & set siteError variable to 1. If the comment field is not

empty, set the comment variable to the data the user entered.

6. Write the PHP code to check the status field. If the status field is empty, set statusError variable to

“Academic Status is Required” & set siteError variable to 1. If the status field is not empty, set the

status variable to the data the user entered.

7. Write the PHP code to check if the siteError variable is not equal to 1 (which indicates there are no error

messages present). If this is true, display all the data that was received from the user, else display the

following error message “There is an error! Check your input.”

HTML section

8. Edit the HTML code of the form to include placeholders which give the user prompts in the browser.

9. In the PHP sections within the HTML code, echo out the appropriate comment variables as indicated.

10. Test your code and take 3 screenshots of the form:

a. Before any data is submitted

Note that the userentered

data is bolded!!

b. When no data or incorrect data is entered

c. When correct data is entered

Tutorials for this Question
Available for

$ 30.00

CISM 4157 ASSIGNMENT 4 CH 12 (2015) SOLUTION

Tutorial # 00053373
Posted On: 03/27/2015 02:33 AM
Posted By:
Best Tutors for school students, college students expert-mustang

Expert tutors with experiences and qualities

Questions:
15716
Tutorials:
15379
Feedback Score:

Report this Tutorial as Inappropriate

Tutorial Preview

… …

Attachments
CISM_4157_ASSIGNMENT_4_CH_12_Solution.zip (86.59 KB)

Purchase this Tutorial @ $30.00 *

* – Additional Paypal / Transaction Handling Fee (3.9% of Tutorial price + $0.30) applicable

Copyright © 2012-2019 HomeworkMinutes.com Uploading copyrighted material is strictly prohibited. Refer to our DMCA Policy for more information.

This is an online marketplace for best solutions and homework help. All the content is provided by third parties and Experts of HomeworkMinutes.com.

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Writedemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order