Create and test php scripts that include arrays

Assignment Help PHP Web Programming
Reference no: EM131109281

PHP: Arrays, Functions and Form processing

Overview

This lab walks you through using PHP to create simple applications. PHP is popular for many Web applications, so becoming comfortable with the syntax of PHP will help you diagnose and identify potential security issues. It is not envisioned you will become an expert in PHP from this course, but you will be able to create simple Web applications; and, in the near future of this course, analyze that code for security issues.

Learning Outcomes:

At the completion of the lab you should be able to:

1. Create and test PHP scripts that include Arrays
2. Create and test PHP scripts that include Functions
3. Create, and test PHP scripts to process HTML Forms
4. Compare and contrast session creating mechanisms in PHP

Lab Submission Requirements:

After completing this lab, you will submit a word (or PDF) document that meets all of the requirements in the description at the end of this document. In addition, your Web Application files should be submitted. You can submit multiple files in a zip file.

Virtual Machine Account Information

Your Virtual Machine has been preconfigured with all of the software you will need for this class. The default username and password are:

Username : umucsdev Password: umuc$d8v

Part 1 - Create and test PHP scripts that include Arrays

This exercise will walk through creating a PHP script that creates, uses and manipulates arrays. We will use the gedit text editor to create the PHP file in the Virtual Machine.

1. After launching the gedit text editor, create a new document and type or copy and paste the PHP code shown below:

2. As before, you can also run the PHP code directly from the shell prompt. To run from the shell prompt, open a shell prompt, change to the location of the ArraysDemo.php file and type:

php ArraysDemo.php

Running from the shell may provide some insight when you php Errors that prevent the cause the script to stop running prior to producing the HTML output.

Part 2 Create and test PHP scripts that include Functions

In this exercise we will create a PHP web page that uses both existing and user-defined PHP functions. Functions are used to help organize code into sub-units to allow for code reuse and reproducible results.

1. Copy and paste the following code into a file named FunctionsDemo.php in the /var/www/html/week4 folder on your Virtual Machine.

2. Launch your Firefox browser and run the Web application. Assuming you placed the file in the /var/www/html/week4 folder you can run this by typing the following URL on your Virtual machine: localhost/week4/FunctionsDemo.php.

3. Reviewing the code you should note the following:

a. Existing PHP functions can be used easily by calling the function name and any required parameters. For this example, sqrt(), deg2rad(), sin(), cos() and tan() existing functions were called.

b. PHP functions you create should be of the format.

https://www.dropbox.com/s/d9micawv81nihae/Lab_PHP_and_Web_Forms.rar?dl=0

Reference no: EM131109281

Questions Cloud

Prerequisite information for modules : STAGE 2 - XML/XQueryConstruct XML representations for the following. Express your design using a diagram and/or a schema.1. Composition of courses, i.e. a list of the modules that make up a course. You may assume that the composition of a course does..
Reaction occurs at constant pressure : Suppose that 0.330 mol of methane, CH4(g), is reacted with 0.480 mol of fluorine, F2(g), forming CF4(g) and HF(g) as sole products. Assuming that the reaction occurs at constant pressure, how much heat is released? Express your answer numerically ..
Prepare a pension worksheet for beatty company for 2010 : During 2010, service cost was $27,500, the settlement rate was 10%, actual and expected return on plan assets were $25,000, contributions were $20,000, and benefits paid were $17,500. Prepare a pension worksheet for Beatty Company for 2010.
Create a chart showing milestones in memory growth : Create a chart showing milestones in memory growth and the approximate date
Create and test php scripts that include arrays : Create and test PHP scripts that include Arrays. After launching the gedit text editor, create a new document and type or copy and paste the PHP code.
Calculations required to evaluate forrester''s proposed : which would increase to 300,000 units per year. Forrester requires a 12% return on investments. Show all necessary calculations required to evaluate Forrester's proposed relaxation of credit standards.
A business case for implementing an e-procurement system : Identify a company that you are familiar with and provide one example of a commodity product they use. I pick WW Grainger as my company. They sell hardware like wrenches.
Compute warrens actual return on plan assets : During the year, contributions to the pension fund were $120,000, and benefits paid were $200,000. Compute Warren's actual return on plan assets.
Find out if this is the company that has been charging me : find out if this is the company that has been charging me?

Reviews

Write a Review

PHP Web Programming Questions & Answers

  Random integral numbers based on normal distribution

Prepare a system to generate random integral numbers based on normal distribution. Study Data Generator's structure and extend number generation type to activate normal distribution.

  Shopping cart program for web applications class

Shopping Cart program for web applications class. Allows user to browse while keeping track of the items in which they will purchase at the end on the order page link and this will give a final price for all items.

  Create a web site for an apple farm

Create a web site for an apple farm. Create an HTML5 form allowing visitors to create an account with the site. Account details are to be stored in your MySQL database. Information should be stored in a secure way.

  Develop a dynamic website open university

Develop a dynamic website Open University

  Sample website project

This website consists of three sections: a narrative, a storyboard, and a business Website.

  Online banking application

Designing and developing a web applications The company you are working has secured a contract with a local banking group to develop an ONLINE BANKING APPLICATION using PHP and MySQL.

  Design a dynamic database

Design a dynamic database using Mangodb, html , and php.

  Show the accessibility and usability of website

The webpage must have several menus about country Azerbaijan such as "About Azerbaijan" "History" "Geography" "Landscape" and "Accessibility" menu.

  Implement a web application

Implement a web application called CS320Starter, which is similar to the crowd funding platform Kickstarter where people raise funds for their projects.

  Prepare an ajax enabled web form

Prepare an AJAX enabled web form utilising a ListView control that will allow logged-in staff to list, edit, delete, insert magazine details for magazines from a selected magazine category.

  Create a very simple order system as a web application

Create a very simple Order System as a web application.

  Which of the following jsp expressions is valid

A JSP expression can contain any Java expression that evaluates to a String object, Java object, primitive type, primitive type or Java object

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