In: Computer Science
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.
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.