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

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms". This assignment will contain two (2) Parts: Written Paper and Visual Basic Prototype. The Visual Basic Prototype is not included in the total page count but is included in the e..

  Visual basic programming discussion

The use of decision logic is one of the major concepts of computer programming. The decision takes your code from being sequential to one that can take various options based on the different conditions. Determine the method of coding that you would u..

  Ticketseller

Use Visual basic 2010Visual Basic,  TicketSeller. This assignment will contain two (2) Parts: Event Planning Document and Coding phase. You must submit both parts as separate files for the completion of this assignment. Remember, you are only to de..

  Data storage & "exception error trapping"

Discussion on Data Storage and  "Exception Error Trapping".

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms".

  The implementation of server side of the application

Implementation of dynamic content, server side (backend) and database for your web site using Microsoft Visual Studio 2012

  Need help building a vwd website

Need help building a VWD website. This website may not go live. I have little progress as a family tragedy has impeded my time for school.

  To develop a visual basic console application

The aim of the assessment is to develop a Visual Basic console application that performs a number of mathematical functions. The mathematics package will be menu driven, i.e. a number of options will be displayed, and the user will be able to input w..

  Program in basic which prompts user to input two integers

Write down the program by using Small Basic which prompts the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum).

  Develop vb-net application that includes arrays and loops

Develop a VB.NET application that includes arrays, loops, and IF statements to do the following. Your output must also display the number of applicant(s) being interviewed.

  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.

  Write a visual logic program to accept series of number

Write a Visual Logic program which accepts a series of numbers, until the first negative value is entered. The maximum number of non-negative input values is 250.

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