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

  Php mysql insertion form that will insert name in customer

php mysql insertion form that will insert name in customer table and have product field that will be a dropdown menu getting product names from the product table database. When inserted it will save student name and product name in relational table. ..

  Proper hypertext markup language and javascript structures

1.proper hypertext markup language html and javascript structures2.error-free3.all pages and images properly saved and

  Simple php script to parse out custom lines

Simple php script to parse out custom lines from an log file and echo - the script should echo it after convert it from hex to normal text

  What php feature automatically adds a backslash

What PHP feature automatically adds a backslash to any single quote, double quote, or NULL character contained in data that a user submits to a PHP script

  Php program to identify leap year

Given a variable called $year, create a PHP program that will print out " is a leap year" or " is not a leap year".

  Evaluate your legal rights as a franchisee to determine if

evaluate your legal rights as a franchisee to determine if they favor the franchisor or the franchisee or both

  Design database table required to store children information

Design the database tables required to store children and class information. In addition to the attributes, be sure to check the needed foreign keys and primary keys.

  Hatfield owned a large fann on which he grew grain his

hatfield owned a large fann on which he grew grain. his combine was inadequate in relation to the acreage of grain

  You are a high level manager who has been asked to present

you are a high level manager who has been asked to present a powerpoint presentation to your employees on the concepts

  1students will present their own definitionconcept of

1students will present their own definitionconcept of corporate social responsibility csr and comparecontrast it with

  Intellectual property and internet lawtrademark

intellectual property and internet lawtrademark infringement. nike inc. manufactures and markets footwear apnotparel

  Purpose of the attach php code searches a mysql database

It works very well, just that it displays all the search results all in one screenful. If it found 100 records then that's how many records it displays to the screen at a time.

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