WDV341 Intro PHP

PHP Basics - Homework Assignment

/* Create a PHP page for this assignment. Use a combination of PHP, HTML and Javascript to perform the following processes.

1. Create a variable called yourName. Assign it a value of your name.

2. Display the assignment name in an h1 element on the page. Include the elements in your output.

Sterne Maher

3. Use HTML to put an h2 element on the page. Use PHP to display your name inside the element using the variable.

Sterne Maher

4. Create the following variables: number1, number2 and total. Assign a value to them.

5. Display the value of each variable and the total variable when you add them together.

number1 = 100

number2 = 200

total = 300

6. Use PHP to create a Javascript array with the following values: PHP,HTML,Javascript. Output this array using PHP. Create a script that will display the values of this array on your page. NOTE: Remember PHP is building the array not running it. Javascript will use the array once the page is processed and returned to the client's browser where HTML and Javascript will do their thing.