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

  Create a visual basic application

Create a visual Basic application that asks the user for two different numbers through text boxes - Then compare the numbers to see which one is higher once they push a button.

  Accept data regarding the purchase of fruit

Continually accept data regarding the purchase of fruit until a sentinel value is entered. Prompt the user for each item, and accept the name of the fruit (e.g., "dried apples"), the price per pound, and the number of pounds sold in a month

  Visual basic program to accept numeral values of any unit

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

  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.

  Gas pump create an application that stimulates the

create an application that stimulates the functionality of the gas pump. user enters the number of gallons to purchase

  Write a loop in pseudocode or visual basic

Write a loop in pseudocode or Visual Basic to print the integers from 10 to 100 counting by 10s

  Prepare a vb application for the subsequent math application

Prepare a VB application for the subsequent Math Application - The problems displayed for the students into two levels.

  Visual basic windows application that uses a do while loop

Create a Visual Basic Windows application to calculate the following series. The value of is to be entered by the user - Create a Visual Basic Windows application that uses a Do While loop.

  Calculates the sum of the mathematical series

Write a Function procedure that implements the above code to calculate 2 to the exponent. This function should accept an Integer value and calculate 2 to that exponent, returning this calculated value in the end - Write a Function procedure that ca..

  Visual basics program to calculate and display charges

Assume that no car parks for longer than 24 hours at a time. Write a visual basics program that calculates and displays the parking charges for each customer who parked a car in this garage.

  Evaluate statements of an expression language

Project involves completing and extending the C++ program that evaluates statements of an expression language contained in the module 3 case study.

  Write paper on creating and accessing arrays

Write a 2 page research paper (excluding the title page) on creating and accessing arrays. Explain the concepts discussed in the textbook using at least one example not included in the textbook

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