Create a PHP page for this assignment. Use a combination of PHP, HTML and Javascript to perform the following processes.
NOTE: Putting your PHP variables into a separate file is optional.
Use the WDV101-DemonstrateInputForm example code for this assignment.
-
Create a variable called yourName. Assign it a value of your name.
-
Display the assignment name in an h1 element on the page. Include the elements in your output.
-
Use HTML to put an h2 element on the page. Use PHP to display your name inside the element using the variable.
-
Create the following variables: number1, number2 and total. Assign a value to them.
-
Display the value of each variable and the total variable when you add them together.
-
Create a PHP variable that is an array containing the values 'PHP', 'HTML' and 'Javascript'. Then, use a PHP loop to iterate through the array and create a javascript array that contains those values. Lastly, write a javascript script that displays the values of the array on the page.
-
This may seem trivial and repetetive, but often times PHP objects/arrays will be returned to your javascript so that you can use the data to interact with the DOM. Especially when using AJAX to talk to your PHP.