Question

In: Computer Science

PHP    1. Create a new PHP document (nit Objective 1)    2. Write a comment...

PHP

   1. Create a new PHP document (nit Objective 1)

   2. Write a comment similar to the following: "This is my first PHP document, which displays some data in the web browser"(Unit Objective 1)

   3. Assign your name as a string value into the variable labeled myName (Unit Objective 2)

   4. Assign 53870 numeric value into the variable named randomNumber (Unit Objective 2)

5. ssign the name of the web browser and operating system of the user accessing the file into the variable named userAgent (Unit Objective 2)

6. Assign the file name of the currently running script into the variable named fileName (Unit Objective 3)

   7. Assign the IP address from which the user is viewing the current page into the variable named ipAddress (Unit Objective 3)

8. Use echo command in order to display some informative descriptions followed by the values of myNem, randomNumber, userAgent, fileName, and ipAddress variables in the web browser. Each informative description and the value pair whould be displayed on a separate line (Unit Objective 4)

9. Save the file as myFirstPHP.php

   10. Create a folder within the public_html folder in your account in people.ysu.edu, name this folder as "e_commerce".

   11. Create another folder within the "e_commerce" folder you just created, and name this folder as "Assignment_1", and upload "myFirstPHP.php" file into the "Assignment_1" folder.

   12. Attach "myFirstPHP.php" file to your response to this assignment, and submit it.

Solutions

Expert Solution

Dear Student ,

myFirstPHP.php :

<?php

//This is my first PHP document, which displays some data in the web browser

$myName="Hitler";//myName

$randomNumber=53870;//randomNumber

//web browser name and operating system

$userAgent=" Microsoft Edge , Windows 10";

//file name

$fileName=" myFirstPHP.php";

//ip address

$ipAddress="192.168.102.10";

echo "I am ".$myName."<br/>";//print myName

echo "Random Number : ".$randomNumber."<br/>";//print randomnumber

echo "Web browser and Operating System name : ".$userAgent."<br/>";//print web browser,Operating System name

echo "Ip Address : ".$ipAddress."<br/>"; //print ip address

?>

Screen 1 :

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.


Related Solutions

Create a new PHP document (Unit Objective 1) Write a comment similar to the following: "This...
Create a new PHP document (Unit Objective 1) Write a comment similar to the following: "This is my first PHP document, which displays some data in the web browser"(Unit Objective 1) Assign your name as a string value into the variable labeled myName (Unit Objective 2) Assign 53870 numeric value into the variable named randomNumber (Unit Objective 2) Assign the name of the web browser and operating system of the user accessing the file into the variable named userAgent (Unit...
Create a new PHP document (Unit Objective 1) Write a comment similar to the following: "This...
Create a new PHP document (Unit Objective 1) Write a comment similar to the following: "This is my first PHP document, which displays some data in the web browser"(Unit Objective 1) Assign your name as a string value into the variable labeled myName (Unit Objective 2) Assign 53870 numeric value into the variable named randomNumber (Unit Objective 2) Assign the name of the web browser and operating system of the user accessing the file into the variable named userAgent (Unit...
PHP Question - Subject: PHP File Handling and Uploads INSTRUCTIONS: Objective: • Create a sticky HTML...
PHP Question - Subject: PHP File Handling and Uploads INSTRUCTIONS: Objective: • Create a sticky HTML form. • Submit form for processing. • Sanitize and validate form data. • Upload a profile image. • Add a record to a text file. • Display form results with content from another text file and the uploaded image. Description: This assignment deals with file management. It requires the use of 3 new files and 1 new directory. You will create the new file-uploads.php...
PHP Question - Subject: PHP File Handling and Uploads INSTRUCTIONS: Objective: • Create a sticky HTML...
PHP Question - Subject: PHP File Handling and Uploads INSTRUCTIONS: Objective: • Create a sticky HTML form. • Submit form for processing. • Sanitize and validate form data. • Upload a profile image. • Add a record to a text file. • Display form results with content from another text file and the uploaded image. Description: This assignment deals with file management. It requires the use of 3 new files and 1 new directory. You will create the new file-uploads.php...
​​​​Python Create a new file named compute_cost.py. Write your name and date in a comment. Create...
​​​​Python Create a new file named compute_cost.py. Write your name and date in a comment. Create a variable named base_fee and set the value to 5.5. Prompt the user for the zone. The zones can be an integer value from 1 to any value for the zone. Convert the zone to an integer. Display the zone on the SenseHat with a scroll speed of 0.3, make the text blue, and the background yellow. Scroll "The zone is " and the...
PHP Question: Subject: Managing Persistence. Objective: • Create a login script. • Strengthen passwords. • Authenticate...
PHP Question: Subject: Managing Persistence. Objective: • Create a login script. • Strengthen passwords. • Authenticate users. • Create sessions. • Create cookies. • Manage persistence. Description: All dynamic sites need a way to manage access to resources. Many dynamic sites use back-end databases that can contain sensitive information that needs to be securely managed. At the same time, sites want to be inviting to guests. Managing the access to sensitive information is a critical function. Requirements: Update site for...
1. PHP OOP Create a complete PHP enabled website that defines and uses a PineApple class...
1. PHP OOP Create a complete PHP enabled website that defines and uses a PineApple class in PHP. The class has following members. Properties $color: string type $taste: string type $weight: number type Standard constructor, with 3 parameters Member functions eat(): no return, no parameter, print a short paragraph in English to describe how to eat a pineapple. grow(): no return, no parameter, print a short paragraph in English to describe how to grow a pineapple plant. display(): no return,...
1. Create a Word document in the Documents library. Write a small “summary or review” of...
1. Create a Word document in the Documents library. Write a small “summary or review” of an interesting “technology article” – The topics can be anything related to recent news in technology “Example: Launching of new gadgets of Apple, or Artificial Intelligence and its uses, Amazon Web Services etc” please include workcited
PHP Question: Subject: Functions and Arrays. INSTRUCTIONS: Objective: • Write functions. • Use server-side includes. •...
PHP Question: Subject: Functions and Arrays. INSTRUCTIONS: Objective: • Write functions. • Use server-side includes. • Create and utilize a numeric array. • Create and utilize an associative array. Requirements: Create a script file called functions.php, where you will be adding functions. priceCalc() function: • 2 parameters: price and quantity. • Create a numeric array of discounts with the following values: 0,0,.05,.1,.2,.25. • Get the discount percent from the array using the quantity as the index. If the quantity is...
- Create an html form (bank form) and the PHP code with 2 accounts with options...
- Create an html form (bank form) and the PHP code with 2 accounts with options to transfer, deposit or withdraw money.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT