Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

For this lab you will use your knowledge of HTML and CSS in order to introduce you to Javascript and PHP for creating dynamic web pages that interact with a web server. As with the previous lab you are NOT permitted to use Dreamweaver or similar software. You should first read:

• HTML forms: www.w3schools.com/html/html forms.asp

• HTML on change: www.w3schools.com/tags/ev onchange.asp

• HTML required: www.w3schools.com/tags/att input required.asp

• Javascript introduction: www.w3schools.com/js/js intro.asp

• Javascript syntax: www.w3schools.com/js/js syntax.asp

• Javascript functions: www.w3schools.com/js/js functions.asp

• Javascript if tests: www.w3schools.com/js/js if else.asp

• PHP introduction: www.w3schools.com/php/php intro.asp

• PHP syntax: www.w3schools.com/php/php syntax.asp

• PHP variables: www.w3schools.com/php/php variables.asp

• PHP printing: www.w3schools.com/php/php echo print.asp

• PHP if tests: www.w3schools.com/php/php if else.asp

• PHP form handling: www.w3schools.com/php/php forms.asp

• PHP dates: www.w3schools.com/php/php date.asp

 

Before you can view your HTML document through a web browser (e.g., Chrome, Firefox, Explorer), it will need to be uploaded to your www folder on the Purdue server and made publicly available.

These instructions are at www.itap.purdue.edu/learning/careeraccount/webpage.html.

• Click the "instructions found on the GoldAnswers self-help knowledge base" link for step-bystep instructions to create a www folder in your CAREER account. The three links on the bottom of that page provide further instructions in the event you encounter problems viewing your web page from a web browser (e.g., you get a permissions-related error).

What to hand in for this question You will upload (1) a screen shot of your website, and (2) the PreLab4.php file. For the screen shot, the address bar of the browser MUST clearly be visible and show the full address on the ITaP server of your web page

This link will have the following format: http://web.ics.purdue.edu/∼[YOUR LOGIN]/IE332/PreLab4.html

The TA will verify your solution by viewing the web page and associated code.

Instructions In this pre-lab, you will create two files, (1) an HTML file to display a dynamic form to the user, and (2) a PHP file that accepts the form data and processes it for redisplay to the user. These files should both be stored in the same directory, within your www folder in your CAREER account.

1. Copy the source code for "A Simple HTML Form" from the w3schools example and save it as PreLab4.html: www.w3schools.com/php/php forms.asp.

2. Edit the HTML form such that it appears exactly as in Figure 1. The drop down selection box will provide five options: None, Chocolate, Ice cream, Fruit and Creme Brule. The blank area is an Error! Filename not specified.with height 200 and width 300, and the second row of the that controls the form layout spans two columns.

2459_1.png

 

3. To your HTML file, you will add an onchange Javascript function that is similar to the example shown in: www.w3schools.com/tags/ev onchange.asp. Specifically, your modification will cause the source to dynamically change based on the user selection of the drop down box. HINTS:

• Use w3schools "Changing the Value of an Attribute" example as a reference: www.w3schools.com/js/js htmldom html.asp.

• Modify your onchange Javascript function to include an if test that causes the source to change based on the dessert menu item clicked on by the user. See Figure 2 for a screenshot of what this should look like.

• The four dessert images are available from the Lab 4 section of Blackboard.

1504_2.png

Figure 2: The website should change the source as the user selects a new option from the drop down box. This must be done with dynamic Javascript.

4. The fields of your form must require nonempty values when the user clicks submit, otherwise an error similar to that shown in  Figure 3 should appear (this automatic error message will likely not appear if viewing the web page in the Safari browser).

737_3.png

Figure 3: If the user clicks ‘Submit' when either the First Name or Last Name text boxes are empty, they should receive an error.
This MUST be done without using Javascript as indicated in the reading materials on the first page of this lab. 3

5. Create another file, name it PreLab4.php (saved in the same directory as your HTML file), by copying the source code in the welcome.php example: www.w3schools.com/php/php forms.asp.

6. Modify your Prelab4.php file such that it produces output similar to that of Figure 4, where the dessert image will coincide with that selected by the user in the HTML form. The other information from the HTML form will also be required to properly recreate this result.

237_4.png

Figure 4: After clicking the ‘Submit' button the user should be redirected to the PreLab4.php file, where the form data will be used to create a website looking like this example. The image will coincide with that chosen by the user.


Attachment:- New WinRAR archive.rar

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91411885
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Programming Language

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As