1. 1 | P a g e
Republic of the Philippines
DEPARTMENT OF EDUCATION
REGION VII- CENTRAL VISAYAS
LILOAN DISTRICT
LILOAN NATIONAL HIGH SCHOOL EXT-DON BOSCO
Web Programming Activity Sheet #1
Name: _________________________________ Date Performed: ________________ Rating: _____________
Introduction to PHP
Learning Objectives
Upon completion of this activity, you will be able to:
• Understand the fundamentals of PHP.
• Explain the proper syntax and operators of PHP.
• Understand the basic on variables and string functions of PHP
• Experiment on the “if else” statements.
• Experiment on the implementation of PHP on Apache server.
Background
PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language.
PHP is now installed on more than 244 million websites and 2.1 million web servers. Originally created by Rasmus Lerdorf in 1995, the
reference implementation of PHP is now produced by The PHP Group. While PHP originally stood for Personal Home Page, it now stands
for PHP: Hypertext Preprocessor, a recursive acronym.
PHP code is interpreted by a web server with a PHP processor module, which generates the resulting web page: PHP commands
can be embedded directly into an HTML source document rather than calling an external file to process data. It has also evolved to include
a command-line interface capability and can be used in standalone graphical applications.
PHP is free software released under the PHP License, which is incompatible with the GNU General Public License (GPL) due to restrictions
on the usage of the term PHP. PHP can be deployed on most web servers and also as a standalone shell on almost every operating system
and platform, free of charge.
What are the three types of PHP file extension? __________________________
What type of scripting language does PHP belongs? __________________________
Scenario
This activity is to be performed on a computer that has Internet access and on which you can install the required web application to implement
data server based Web Server running on Apache with MySQL database and using PHP scripting. Estimated completion time, depending
on network speed, is 3 hours.
Task 1: Create a PHP file using notepad++ software and save the filename to “index.php”. Use the guide below for the content of
your php file. Remember, you may have to use updated web browser for better code functionality. Write down the name and specific version
of the web browser used? Browser Name ________________ Version: _______________
Figure 1. Web Content Display
Task 2: Write your PHP code that will display the Figure 1.
Refer to Figure 1, the screen should tell whether it is morning, afternoon or evening using the system time of your computer. Assign
three (3) variables for the name displayed that will correspond to your first name family name and Middle initial. Change the name with your
own name. The middle initial should be displayed using the string statement that will only display the first letter of it followed by a dot (.) Feel
free to change the color, size and font style of the content.
2. 2 | P a g e
Write the PHP code below:
Task 3. Write down a brief explanation of your PHP code.
3. 3 | P a g e
Task 4. Install WAMP server on your computer. Make sure to install the proper installer for 32bit or 64bit Operating system. Write
down the following details after installation.
WAMP Version: _____________ Apache Server Version: _____________
PHP Admin: ________________ MySQL Server Version: ______________
Write down the three WAMP color status and its meaning.
______________________________________________________________________
Task 5. Open C:WAMPWWW directory and replace the index.php with the one you created.
Task 6. Open http://localhost on your preferred web browser. Check if it will display the php file you’ve created.
Challenge:
1. Define PHP variables and write down the variables used in this activity.
2. Write down at least 3 types of PHP data types and define each.
3. How does php ECHO differs from PRINT?
4. Write down the specific STRING function being used in this activity.
Activity Observation and Summary:
____________________________________________________________________________________________
____________________________________________________________________________________________
____________________________________________________________________________________________
____________________________________________________________
.