PC2102-Module-1-4 2
PC2102-Module-1-4 2
d Te c h o lo
an
ems
Web Systems
e b Sy s t
1 02 W
PC-2
and
Technologies
MODULE 1 PREPARED BY: JOHN WILSON RELOVA
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
s PC
l og ie -21
o 02
Tec h We
n d b Sy
m sa st e
st e ms
Sy an
d
Web Tec
0 2 h o lo
C-21 g ie
P s
1
Fundamentals of
Web Systems
g ie s
d Te c h o lo
an
e b Sy s t
ems Introduction
1 02 W
PC-2
b Sy s t
ems
an Lesson 1
d T
e
02 W
PC-2
1
Fundamentals of Web System
b Sy s t
ems
an Lesson 1
d T
e
02 W
PC-2
1
Fundamentals of Web System
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1.1
e
02 W
PC-2
1
What is Web Technology?
Web Technology refers to the various tools and
techniques that are utilized in the process of
communication between different types of
devices over the Internet. A web browser is used
to access web pages. Web browsers can be
defined as programs that display text, data,
pictures, animation, and video on the Internet
(Geekforgeeks 2021). hol ogies
c
nd Te a
y s t ems
2 Web S
10
PC-2
g ie s
e c h o lo
b Sy s t
ems Lesson 1.1
an d T
e
02 W
PC-2
1
What is Web Technology?
Web technologies include the following:
✓ Mark-up languages, such as HTML, CSS,
XML(AJAX, JavaScript), CGI, and HTTP (Front-
end or Client-side technologies)
✓ Programming languages and technologies that
help create applications for the web. Some of
these are PHP, Perl, C#, Java, Node.js, Golang
gies
and .NET (Back-end or Server-side technologies)
and T
ec hol o
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1.2
e
02 W
PC-2
1
Top Web Technologies
This is the top web technologies to learn today
(Geekforgeeks 2021).
1. HTML5 - If you know this language, knowing all the
others is a walk in the park. This recent addition to the
HTML family is very equipped and potent in assisting
in web development activities.
2. JavaScript - This programming language lets you
make communication for your website. It was
developed by Netscape and borrows a lot of its syntaxologies
Tech
from the C language. stem
sa n d
Web Sy
C-2 102
P
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1.2
e
02 W
PC-2
1
Top Web Technologies
3. Java - This is the top programming language in the
industry and is currently the perfect language for web
development. Created by Sun Microsystems in the 1990s,
this language is not platform dependent, so using Java and
creating Java-based applications is extremely easy.
4. PHP - This stands for PHP Hypertext Processor. It is one
of the widely-used languages for web development and was
created in 2004. It is an HTML-embedded scripting language
and is useful for creating dynamic web pages. hol ogies
Tec
t ems and
Sy s
02 Web
1
PC-2
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1.2
e
02 W
PC-2
1
Top Web Technologies
5. Python - This is an advanced programming language and
is used for creating websites and mobile apps. It is very
flexible and has a broad range of applications. It can run on
both Linux and Windows-based servers.
b Sy s t
ems
an d T
Lesson 1.2
e
02 W
PC-2
1
Top Web Technologies
7. C - This is a standard programming language created in
the 1970s. It is appreciated for its efficiency and is known for
writing system software. It is also used for writing
applications.
b Sy s t
ems
an d T
Lesson 1.2
e
02 W
PC-2
1
Top Web Technologies
9. C# - This is a multi-paradigm programming language and
is a general-purpose language, used to build up software for
the Microsoft and Windows platforms.
b Sy s t
ems
an d T
Lesson 1.2
e
02 W
PC-2
1
Top Web Technologies
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1.2
e
02 W
PC-2
1
Top Web Technologies
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
s PC
l og ie -21
o 02
Tec h We
n d b Sy
m sa st e
st e ms
Sy an
d
Web Tec
0 2 h o lo
C-21 g ie
P s
2
Client Server
Architecture
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 2
e
02 W
PC-2
1
Client Server Architecture
Based in the article “Computer
Basics” by Edu.gcfglobal.org
(2020), client-server architecture
is an architecture of a computer
network in which many clients
(remote processors) request and
receive service from a
centralized server (host
computer).
ol ogies
an d Tech
s
S ystem
02 Web
C-21
g ie s
c h o lo
Sy s t
ems
an d Te
Lesson 2
e b
PC-2
1 02 W
Client Server Architecture
✓ Clients are the web user's internet-connected devices (for
example, your personal computer connected to your wireless
connection or Wi-Fi, or your smartphone connected to your
mobile network like data) and web-accessing software available
on those devices (a web browser like Firefox or Chrome).
hol ogies
ec
and T
yst ems
b S
We
d Te c h o loLesson 2.1
g ie s
an
ems
1 02 W
e b Sy s t Traditional Web based
PC-2
Systems
In addition to HTTP and Client and Server Architecture
(Edu.gcfglobal.org, 2020)
✓ Internet connection - Allows you to send and receive data
on the web.
✓ TCP/IP - Transmission Control Protocol and Internet Protocol
are communication protocols that define how data should travel
across the web.
✓ DNS - Domain Name Servers are like an address book for
websites.
ol ogies
an d Tech
s
S ystem
02 Web
C-21
d Te c h o loLesson 2.1
g ie s
an
ems
1 02 W
e b Sy s t Traditional Web based
PC-2
Systems
✓ Component file - A website is made up of many different
files, which are like the different parts of the goods you buy
from the shop. These files come in two main types:
o Code files - Websites are built primarily from HTML, CSS,
JavaScript, PHP, and MySQL though you'll meet other
technologies a bit later.
o Assets - This is a collective name for all the other stuff that
makes up a website, such as images, music, video, Word
documents, and PDFs. ies
ol og
an d Tech
s
S ystem
02 Web
C-21
g ie s
Te c h o lo
emsLesson 2.2
an d
e b Sy s t
02 W
PC-2
1 Advantages and Disadvantages of
Advantages Client Server Architecture
✓ Improved Data Sharing - Data is retained by usual business
processes and manipulated on a server is available for
designated users (clients) over authorized access.
✓ Integration of Services - Every client is allowed to access
corporate information via the desktop interface eliminating the
necessity to log into a terminal mode or another processor.
✓ Shared Resources amongst Different Platforms -
Applications used for the client/server model are built
regardless of the hardware platform or technical background of ie
the entitled software (Operating System S/W) Tec holog
s and
Sy stem
Web
g ie s
Te c h o lo
ems Lesson 2.2
an d
e b Sy s t
02 W
PC-2
1 Advantages and Disadvantages of
Client Server Architecture
Advantages
✓ Inter-Operation of Data - All development tools used
for client/server applications access the back-end
database server through SQL, an industry standard data
definition and access language, helpful for consistent
management of corporate data.
✓ Data Processing capability despite the location -
We are in an era that undergoes a transformation of
machine-centered systems to user-centered systems. logie
d Techo
t ems an
S y s
Web
g ie s
Te c h o lo
ems
anLesson 2.2
d
e b Sy s t
02 W
PC-2
1 Advantages and Disadvantages of
Client Server Architecture
Advantages
✓ Easy maintenance - Since client/server architecture is
a distributed model representing dispersed responsibilities
among independent computers integrated across a
network, it’s an advantage in terms of maintenance.
✓ Security - Servers have better control access and
resources to ensure that only authorized clients can
access or manipulate data and server-updates are
administered effectively. logie
d Techo
t ems an
S y s
Web
g ie s
Te c h o lo
ems Lesson 2.2
an d
e b Sy s t
02 W
PC-2
1 Advantages and Disadvantages of
Client Server Architecture
Disadvantages
✓ Overloaded servers - When there are
frequent simultaneous client requests, servers
severely get overloaded, forming traffic
congestion.
✓ Impact of centralized architecture - Since its
centralized if a critical server fails, client requests
are not accomplished. ologi
e
d Tech
t ems an
S y s
Web
PC-2
209
Netw
o rking
1
Any
Question?
PC-2
209
Netw
o rking
1
PC-2
209
Netw
o rking
1
THANK YOU
PC-2
209
Netw
o rking
1
g ie s
d Te c h o lo
an
ems
e b Sy s t
1 02 W
PC-2
DOMAIN NAME
SYSTEM (DNS)
MODULE 2
PREPARED BY: JOHN WILSON RELOVA
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
s PC
l og ie -21
o 02
Tec h We
n d b Sy
m sa st e
st e ms
Sy an
d
Web Tec
0 2 h o lo
C-21 g ie
P s
1
Domain Name
System
g ie s
d Te c h o lo
an
e b Sy s t
ems Introduction
1 02 W
PC-2
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
d Te c h o lo
an
e b Sy s t
ems Learning Outcomes
1 02 W
PC-2
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1
e
02 W
PC-2
1
Domain Name System (DNS)
b Sy s t
ems
an d T
Lesson 1
e
02 W
PC-2
1
Domain Name System (DNS)
Importance of DNS
b Sy s t
ems
an d T
Lesson 1.1
e
02 W
PC-2
1
Internet Protocol (IP
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
Te c h o lo
e b Sy s t
ems
an d
Lesson 2.
02 W
PC-2
1
DNS Network
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
Te c h o lo
e b Sy s t
ems
an d
Lesson 2.
02 W
PC-2
1
DNS Network
However, there are other a couple of other
crucial aspects of DNS that underpin its
functionality (Fisher, 2020):
✓ Distribution
✓ Record Maintenance
✓ Domain Namespace Hierarchy
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
Te c h o lo
e b Sy s t
ems
an d
Lesson 2.1
02 W
PC-2
1
Domain Namespace
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
Te c h o lo
e b Sy s t
ems
an d
Lesson 2.1
02 W
PC-2
1
Domain Namespace
e b Sy s t
ems Lesson 2.2
an d
02 W
PC-2
1
How DNS Work?
An IP address is given to each device on the
Internet, and that address is necessary to find the
appropriate Internet device - like a street address
is used to find a particular home. When a user
wants to load a webpage, a translation must occur
between what a user types into their web
browser (google.com) and the machine-friendly
address necessary to locate the google.com hol ogies
n d Tec
webpage. eb S y stem
s a
-2 102 W
PC
g ie s
Te c h o lo
e b Sy s t
ems Lesson 2.2
an d
02 W
PC-2
1
How DNS Work?
4 DNS Servers involved in loading a Webpage
e b Sy s t
ems Lesson 2.2
an d
02 W
PC-2
1
How DNS Work?
4 DNS Servers involved in loading a Webpage
ec hologi
and T
y s t ems
eb S
g ie s
Te c h o lo
e b Sy s t
emsLesson 2.4
an d
02 W
PC-2
1
Authoritative DNS Server
Authoritative DNS server is a server that actually
holds, and is responsible for, DNS resource
records.
ec hologi
and T
y s t ems
eb S
g ie s
Te c h o lo
e b Sy s t
ems
an d
Lesson 2.4
02 W
PC-2
1
Authoritative DNS Server
Difference between Authoritative DNS server &
Recursive DNS Server
ec hologi
and T
y s t ems
eb S
g ie s
Te c h o lo
e b Sy s t Lesson 2.4
ems
an d
02 W
PC-2
1
Authoritative DNS Server
DNS Resolver
e b Sy s t
ems
an d
Lesson 2.4
02 W
PC-2
1
Authoritative DNS Server
DNS Resolver
ec hologi
and T
y s t ems
eb S
g ie s
Te c h o lo
e b Sy s t
ems
an d
Lesson 2.4
02 W
PC-2
1
Authoritative DNS Server
3 Types of Queries
✓ Recursive query
✓ Iterative query
✓ Non-recursive query
ec hologi
and T
y s t ems
eb S
g ie s
Te c h o lo
e b Sy s t
ems
an
Lesson 3.
d
02 W
PC-2
1
DNS Lookup
DNS is concerned with a domain name being
translated into the appropriate IP address.
ec hologi
and T
y s t ems
eb S
PC-2
209
Netw
o rking
1
Any
Question?
PC-2
209
Netw
o rking
1
PC-2
209
Netw
o rking
1
THANK YOU
PC-2
209
Netw
o rking
1
g ie s
d Te c h o lo
an
ems
Scripting and
e b Sy s t
1 02 W
PC-2
Server-Side
Programming
MODULE 3 PREPARED BY: JOHN WILSON RELOVA
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
s PC
l og ie -21
o 02
Tec h We
n d b Sy
m sa st e
st e ms
Sy an
d
Web Tec
0 2 h o lo
C-21 g ie
P s
1
Scripting Language
g ie s
d Te c h o lo
an
e b Sy s t
ems Introduction
1 02 W
PC-2
All scripting and server-side languages are
programming languages. The scripting
language is a language where instructions are
written for a run time environment. They do not
require the compilation step and are rather
interpreted. It brings new functions to
applications and glues a complex system
together. c hol ogies
an d Te
s
ystem
2 Web S
10
PC-2
g ie s
d Te c h o lo
an
e b Sy s t
ems Learning Outcomes
1 02 W
PC-2
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1
e
02 W
PC-2
1
Scripting Language
b Sy s t
ems
an d T
Lesson 1
e
02 W
PC-2
1
Scripting Language
✓ Ease of use
✓ OS facilities
✓ Interpreted from source code
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1
e
02 W
PC-2
1
Scripting Language
b Sy s t
ems
an d T
Lesson 1
e
02 W
PC-2
1
Scripting Language
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1
e
02 W
PC-2
1
Scripting Language
Two Types of Scripting Language
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1.1
e
02 W
PC-2
1
Server side VS. Client Side
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1.1
e
02 W
PC-2
1
Server side VS. Client Side
The server-side code handles tasks like
validating submitted data and requests,
using databases to store and retrieve data,
and sending the correct data to the client as
required. The benefit of client-side scripts is
that they can reduce demand on the server,
allowing web pages to load faster.
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
ems
an d TLesson 1.2
e c h o lo
Sy s t
PC- 2 1 0 Server
2 We
b
Side Scripting Languages and
its applications.
1. PHP - The PHP Hypertext Preprocessor (PHP) is
a programming language that allows web
developers to create dynamic content that
interacts with databases.
2. ASP.NET - is a web development platform,
which provides a programming model, a
comprehensive software infrastructure. ologi
es
n d Tech
sa
ystem
2 Web S
10
PC-2
g ie s
c h o lo
y stem
s an d TLesson 1.2
e
b S
PC- 2 1 0 Server Side Scripting Languages and
2 We
its applications.
. The ASP.NET application codes can be written in
any of the following languages :
2 Web S
10
PC-2
g ie s
c h o lo
y stem
s an d TLesson 1.2
e
b S
PC- 2 1 0 Server Side Scripting Languages and
2 We
its applications.
✓ Jscript - is a script language from Microsoft that
is expressly designed for use within Web pages.
its applications.
3. Node.js - is a platform built on Chrome's
JavaScript runtime for easily building fast and
scalable network applications.
Features of Node.js
✓ Asynchronous and Event Driven ✓ Very
Fast
✓ Single Threaded but highly scalable ✓ Licenseologies
Tech
✓ No Buffering ystem
san d
2 Web S
10
PC-2
g ie s
c h o lo
y stem
s an d Te
Lesson 1.2
b S
PC- 2 1 0 Server Side Scripting Languages and
2 We
its applications.
4. Python - is one of the most acceptable
languages among web and application developers
because of its strong emphasis on efficiency and
readability.
Python Frameworks
✓ Django gies
hol o
✓ Flask ems
and T
ec
eb Sy s t
-2 102 W
PC
g ie s
c h o lo
y stem
s an d TLesson 1.2
e
b S
PC- 2 1 0 Server Side Scripting Languages and
2 We
its applications.
5. Perl - is a general-purpose programming language
originally developed for text manipulation and now used for
a wide range of tasks including system administration, web
development, and more.
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
ems
an d Lesson 1.3
Te c h o lo
Sy s t
2 1 0 2Client
Web Side Scripting Languages and its
PC-
application
2. CSS - Cascading Style Sheets, fondly referred to as CSS,
is a simple design language intended to simplify the
process of making web pages presentable.
2
Server Side
Programming
g ie s
d Te c h o lo
an
e b Sy s t
ems Lesson 2.
1 02 W
PC-2
Server Side Programming
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
PC
g ie s -21
c h o lo 02
nd Te We
eb S
ystem
s a
Lesson 2.2 b Sy
st e
1 02 W ms
PC-2
Dynamic Websites an
d Tec
h o lo
g ie
s
PC
g ie s -21
c h o lo 02
nd Te We
eb S
ystem
s
Lesson 2.3
a
Sy
st e
b
1 02 W ms
PC-2
Static Website vs. Dynamic Website an
dT
ec h
o lo
g ie
s
g ie s
Lesson 2.4
an d Te c h o lo
ems
Sy s t
102
Web Benefits and Uses of Server-Side
PC-2
Programming
Any
Question?
PC-2
209
Netw
o rking
1
PC-2
209
Netw
o rking
1
THANK YOU
PC-2
209
Netw
o rking
1
g ie s
d Te c h o lo
an
ems
e b Sy s t
1 02 W
PC-2
PHP
Environment
MODULE 4
PREPARED BY: JOHN WILSON RELOVA
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
s PC
l og ie -21
o 02
Tec h We
n d b Sy
m sa st e
st e ms
Sy an
d
Web Tec
0 2 h o lo
C-21 g ie
P s
1
Overview of PHP
g ie s
d Te c h o lo
an
e b Sy s t
ems Introduction
1 02 W
PC-2
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
d Te c h o lo
an
e b Sy s t
ems Learning Outcomes
1 02 W
PC-2
b Sy s t
ems
an d T
Lesson 1.
e
02 W
PC-2
1
Overview of PHP
b Sy s t
ems
an d T
Lesson 1.
e
02 W
PC-2
1
Overview of PHP
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1.1
e
02 W
PC-2
1
Why to Learn PHP?
PHP is a MUST for students and working
professionals especially when they are working
in Web Development Domain. I will list down
some of the key advantages of learning PHP :
b Sy s t
emsLesson 1.1
an d T
e
02 W
PC-2
1
Why to Learn PHP?
✓ It is integrated with a number of popular
databases, including MySQL, PostgreSQL,
Oracle, Sybase, Informix, and Microsoft SQL
Server.
b Sy s t
ems
an d T
Lesson 1.1
e
02 W
PC-2
1
Why to Learn PHP?
b Sy s t
ems Lesson 1.1
an d T
e
02 W
PC-2
1
Why to Learn PHP?
✓ PHP is forgiving: PHP language tries to be
as forgiving as possible.
✓ PHP Syntax is C-Like.
✓ PHP has a large community.
PHP can actually do anything related to server-side
scripting or more popularly known as the backend of a
hol ogies
website. s an d Tec
em
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1.1
e
02 W
PC-2
1
Why to Learn PHP?
Characteristics of PHP
Five important characteristics make PHP's
practical nature possible:
✓ Simplicity ✓ Security
✓ Efficiency ✓ Flexibility
✓ Familiarity ec hol ogies
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 1.2
e
02 W
PC-2
1
Applications of PHP
As mentioned before, PHP is one of the most widely
used language over the web. I'm going to list few of
them here (Geekforgeeks 2021):
2
PHP Environment
Setup using XAMPP
an d Te c h o lo Lesson 2.
g ie s
s
stem
- 2 1 0 2 We
b S y
PHP Environment Setup using
P C
XAMPP
In order to develop and run PHP Web pages
three vital components need to be installed on
your computer system
b Sy s t
ems
an d T
Lesson 2.1
e
02 W
PC-2
1
What is XAMPP?
XAMPP is an open source cross platform web server,
MySQL database engine, and PHP and Perl package. It is
compiled and maintained by apache.
b Sy s t
ems
an d T
Lesson 2.1
e
02 W
PC-2
1
What is XAMPP?
Why use XAMPP?
b Sy s t
ems
an d T
Lesson 2.3
e
02 W
PC-2
1
XAMPP Configuration
Assuming that you have installed XAMPP on drive C in
Windows using the steps mentioned above. The following
is a list of the basic directories that you are supposed to be
aware of
✓ htdocs - this is the web root directory. All of our
PHP codes will be placed in this directory.
✓ mysql – this directory contains all the information
related to MySQL database engine, by default it runs
on port 3306.
✓ php – this directory contains PHP installation files.
It contains an important file named php.ini. This
directory is used to configure how PHP behaves on
your server.
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 2.4
e
02 W
PC-2
1
XAMPP Control Panel
The control panel is used to manage programs installed via XAMPP.
To open the XAMPP control panel (Geekforgeeks 2021).
✓ Click on start menu.
✓ Explore the programs directory and locate Apace Friends then
XAMPP as shown in the diagram below.
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 2.4
e
02 W
PC-2
1
XAMPP Control Panel
✓ The diagram below shows the control panel.
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
s PC
l og ie -21
o 02
Tec h We
n d b Sy
m sa st e
st e ms
Sy an
d
Web Tec
0 2 h o lo
C-21 g ie
P s
3
PHP Syntax
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 3
e
02 W
PC-2
1
PHP Syntax
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems Lesson 3
an d T
e
02 W
PC-2
1
PHP Syntax
The default file extension for PHP files is ".php". A
PHP file normally contains HTML tags, and some
PHP scripting code. Below, we have an example
of a simple PHP file, with a PHP script that uses a
built-in PHP function "echo" to output the text
"Hello World!" on a web page: Create your own
and name it as “sample.php”
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 3
e
02 W
PC-2
1
PHP Syntax
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an Lesson 3.1
d T
e
02 W
PC-2
1
Running PHP Scripts in XAMPP
b Sy s t
emsLesson 3.2
an d T
e
02 W
PC-2
1
Commenting to PHP
A comment is the portion of a program that exists
only for the human reader and stripped out before
displaying the programs result. There are two
commenting formats in PHP:
2 Web S
10
PC-2
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 3.2
e
02 W
PC-2
1
Commenting to PHP
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 3.2
e
02 W
PC-2
1
Commenting to PHP
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 3.2
e
02 W
PC-2
1
Commenting to PHP
hol ogies
ec
and T
ems
eb Sy s t
-2 102 W
PC
s PC
l og ie -21
o 02
Tec h We
n d b Sy
m sa st e
st e ms
Sy an
d
Web Tec
0 2 h o lo
C-21 g ie
P s
4
PHP Variable Types
g ie s
e c h o lo
b Sy s t
emsLesson 4
an d T
e
02 W
Here are thePHP
mostVariable
important Types
1
PC-2
things to know about
variables in PHP.
• All variables in PHP are denoted with a leading dollar
sign ($).
• The value of a variable is the value of its most recent
assignment.
• Variables are assigned with the = operator, with the
variable on the left-hand side and the expression to be
evaluated on the right.
• Variables can, but do not need, to be declared before hol ogies
an d Tec
assignment. b S y stem
s
02 We
1
PC-2
g ie s
e c h o lo
b Sy s t
ems Lesson 4
an d T
e
02 W
• Variables PHP Variable Types
1
PC-2
in PHP do not have intrinsic types - a
variable does not know in advance whether it
will be used to store a number or a string of
characters.
• Variables used before they are assigned have
default values.
• PHP does a good job of automatically
converting types from one to another when es
ologi
necessary. ms a
nd Tec h
s te
Web Sy
C-2 102
P
g ie s
e c h o lo
b Sy s t
ems Lesson 4
an d T
e
02 W
PC-2
1
PHP Variable Types
Simple/Scalar Types
• Integers − are whole numbers, without a
decimal point, like 4195.
• Doubles − are floating-point numbers, like
3.14159 or 49.1.
• Booleans − have only two possible values
either true or false.
• Strings − are sequences of characters, like
'PHP supports string operations.'
g ie s
e c h o lo
b Sy s t
Lesson 4
ems
an d T
e
02 W
PC-2
1
PHP Variable Types
Compound Types
b Sy s t
ems
an d T
Lesson 4
e
02 W
PC-2
1
PHP Variable Types
Special Types
b Sy s t
emsLesson 4.1
an d T
e
02 W
PC-2
1
PHP Variable Types
They are whole numbers, without a decimal point,
like 4195. They are the simplest type. They
correspond to simple whole numbers, both
positive and negative. Integers can be assigned to
variables, or they can be used in expressions, like
so
g ie s
e c h o lo
b Sy s t
Lesson 4.1
ems
an d T
e
02 W
PC-2
1
PHP Variable Types
Integer can be in decimal (base 10), octal (base
8), and hexadecimal (base 16) format. Decimal
format is the default, octal integers are specified
with a leading 0, and hexadecimals have a
leading 0x.
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 4.2
e
02 W
PC-2
1
Doubles
They like 3.14159 or 49.1. By default, doubles print with
the minimum number of decimal places needed. For
example, the code:
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 4.3
e
02 W
PC-2
1
Booleans
Based in the “PHP Tutorial” by tutorialspoint (n.d), they
have only two possible values either true or false. PHP
provides a couple of constants especially for use as
Booleans: TRUE and FALSE, which can be used like so.
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 4.3
e
02 W
PC-2
1
Booleans
Each of the following variables has the truth value
embedded in its name when it is used in a Boolean
context.
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 4.4
e
02 W
PC-2
1
NULL
Based in the “PHP Tutorial” by tutorialspoint (n.d), NULL is a special
type that only has one value: NULL. To give a variable the NULL
value, simply assign it like this.
b Sy s t
ems
an d T
Lesson 4.5
e
02 W
PC-2
1
Strings
Based in the “PHP Tutorial” by tutorialspoint (n.d), they are
sequences of characters, like "PHP supports string
operations". Following are valid examples of string.
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 4.5
e
02 W
PC-2
1
Strings
Singly quoted strings are treated almost literally, whereas doubly
quoted strings replace variables with their values as well as specially
interpreting certain character sequences.
s PC
l og ie -21
o 02
Tec h We
n d b Sy
m sa st e
st e ms
Sy an
d
Web Tec
0 2 h o lo
C-21 g ie
P s
5
Variable Scope
PC
g ie s -21
c h o lo 02
nd Te
ystem
s a Lesson 5 We
b Sy
eb S st e
02 W
PC-2
1
Variable Scope ms
an
d Tec
h o lo
g ie
s
The scope of a variable is defined as its extent in
the program within which it can be accessed, i.e.
the scope of a variable is the portion of the
program within which it is visible or can be
accessed.
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 5
e
02 W
PC-2
1
Variable Scope
b Sy s t
ems
an d T
Lesson 5
e
02 W
PC-2
1
Variable Scope
b Sy s t
ems
an d T
Lesson 5
e
02 W
PC-2
1
Variable Scope
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 5
e
02 W
PC-2
1
Variable Scope
b Sy s t
ems
an d T
Lesson 5
e
02 W
PC-2
1
Variable Scope
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 5
e
02 W
PC-2
1
Variable Scope
b Sy s t
ems
an d T
Lesson 5
e
02 W
PC-2
1
Variable Scope
s PC
l og ie -21
o 02
Tec h We
n d b Sy
m sa st e
st e ms
Sy an
d
Web Tec
0 2 h o lo
C-21 g ie
P s
6
Variable Naming
g ie s
e c h o lo
b Sy s t
ems
an d T
Lesson 6
e
02 W
PC-2
1
Variable Naming
Based in the “PHP Tutorial” by geeksforgeeks (2022), a variable can
have a short name (like x and y) or a more descriptive name (age,
carname, total_volume).
Any
Question?
PC-2
209
Netw
o rking
1
PC-2
209
Netw
o rking
1
THANK YOU
PC-2
209
Netw
o rking
1