Create the following variables to store error messages

Assignment Help Visual Basic Programming
Reference no: EM13927346

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 user-entered data is bolded!!

b. When no data or incorrect data is entered

c. When correct data is entered 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 user-entered data is bolded!!

b. When no data or incorrect data is entered

c. When correct data is entered

 

Reference no: EM13927346

Questions Cloud

What is best estimate of the price you can recommend : If you had to make a recommendation regarding the pricing of this order, what is the best estimate of the price (in CHF) you can recommend that management charge if it wants to just cover its costs and profit objectives?
What is npv of a project that required net investment : What is the NPV of a project that required a net investment of $500,000 and produced net cash flows of $150,000 per year for the next 5 years and $110,000 for the sixth year? Assume the cost of capital is 14%.
Example of trade diversion : Question 1: Which of the following is an example of trade diversion? Question 2: Which of the following is FALSE?
When searching for a peer reviewed article/ journal : When searching for a peer reviewed article/ journal, how do you quickly determine this is a valid, academically recognized source of information? Are there any considerations to how long ago the information was published----why or why not?
Create the following variables to store error messages : Edit the HTML code of the form to include placeholders which give the user prompts in the browser.
Computed chi square and the critical chi square : Based on comparing the computed Chi square and the critical Chi square, which of the following is (are) true?
Evaluate wide area network (wan) technologies : Create a table to compare Novell, Windows, Mac, UNIX, and Linux server operating systems. You should identify the most recent server operating system for each to consider. For Linux and UNIX which have multiple variants, you may choose one current..
Implement euler integration scheme : Implement Euler integration scheme and implement Runge-Kutta integration scheme. The latter phenomenon is known as the butterfly effect.
One-tailed and two-tailed test : 1. Explain Type I and Type II errors. Use an example if needed. 2. Explain a one-tailed and two-tailed test. Use an example if needed.

Reviews

Write a Review

Visual Basic Programming Questions & Answers

  Visual basic program to accept numeral values

Write a VISUAL BASIC program to accept numeral values of any unit, sum up the total, calculate the average, and then Output the result with a proper unit.

  Gas pumpa gas pump calculates the cost of gas at a local

gas pumpa gas pump calculates the cost of gas at a local gas station. the station charges 2.69 per gallon for regular

  Display in message label when statements are executed

What will display in MessageLabel when the following statements are executed? Assume that CountInteger = 10. MessageString = "Visual Basic is fun" IF CountInteger

  Write a program that displays the patterns separately

Write a program that displays the patterns separately, one below the other in a TextBox - Maximize your use of repetition and maximize the number of output statements.

  Create a vb form application that contains two listboxes

Create a VB form application that contains two listboxes and two buttons. The application starts off with both lists empty. Button 1 will clear both lists and then add 25 randomly generated number to the first list. The numbers will vary in value ..

  Describe the key components of a computerized office

Describe the key components of a computerized office and explain the primary software fundamentals and describe a variety of productivity applications.

  Effectiveness of the design and proposed program

Evaluate the overall design of the application and draw appropriate conclusions as to the effectiveness of the design and proposed program - Discuss and justify a means of representing the results of the calculations via an appropriate medium/objec..

  Arithmetic calculator applicationwrite an application that

arithmetic calculator applicationwrite an application that allows the user to enter a series of numbers and manipulate

  Create visual basics application-functionality of gas pump

Create an visual basics application that simulates the functionality of the gas pump. The user enters the number of gallons to purchase and clicks the desired grade.

  Permit a user to manipulate database using vb

Use VB to permit a user to manipulate database according to following: Permit the user to scroll through list of students while showing student ID, student name, advisor name, and department.

  Shipping charge for the following zip codes

Need application code for visual basic should display the appropriate shipping charge. shipping charge for the following ZIP codes is $32: 60618, 60620, and 60632. All other ZIP codes are charged $37.75. Code the application in visual basic

  Modify the gate takings application

Your application from Activity 1 was able to keep a record of the total attendance and the total cash collected from ticket sales from all events happening at the Games.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd