Midterm - Lecture 2 - WEBAPPS

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

WEB APPLICATIONS DEVELOPMENT

PHP

Week 8
WEB APPLICATIONS DEVELOPMENT - CIT

Prayer for today


Ama sa Langit, bigyan kami ngayong araw upang matupad ang aming
mga tungkulin bilang responsable at mabait na mag-aaral.
Bigyan kami ng gabay at pangangalaga sa pagtupad ng aming mga
gawain.
Bigyan mo kami ng tulong sa mga desisyon na aming ginagawa.
Nanalangin kami sa iyo na pagpalain ang aming mga guro para sa
matiyagang paghahatid sa amin araw-araw na mga aralin.
Pagpalain ang aming mga magulang sa patuloy na pagsuporta sa amin.
Maraming salamat, Lord sa lahat ng mga biyayang ibinibigay mo sa
aming lahat. Ikaw ang aming suporta at lakas.
Amen.
2
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

Learning Outcomes
1. Know what PHP is and its use.
2. Learn how to setup PHP development environment.
3. Learn the different PHP fundamentals.

3
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
What is PHP?
WEB APPLICATIONS DEVELOPMENT - CIT

PHP
- PHP stands for PHP Hypertext Preprocessor
- PHP is a server scripting language, and a powerful tool for making
dynamic and interactive Web pages.
- PHP is a widely-used, free, and efficient alternative to competitors
such as Microsoft’s ASP.
- PHP scripts are executed on the server.
- PHP 8.1 is the latest major PHP version.

5
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

PHP is an amazing and popular language!


- It is powerful enough to be at the core of the biggest blogging system
on the web (WordPress)!
- It is deep enough to run large social networks!
- It is also enough to be a beginner’s first server side language!

6
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

What is a PHP file?


- PHP files can contain text, HTML, CSS, JavaScript, and PHP code.
- PHP code is executed on the server, and the result is returned to the
browser as plain HTML.
- PHP files have extension “.php”

7
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

What can PHP do?


- PHP can generate dynamic page content
- PHP can create, open, read, write, delete and close files on the
server.
- PHP can collect form data.
- PHP can send and receive cookies.
- PHP can add, delete, modify data in your database.
- PHP can be used to control user-access

8
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
Installing PHP
WEB APPLICATIONS DEVELOPMENT - CIT

XAMPP Control Panel

10
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

XAMPP Control Panel


(https://www.apachefriends.org/index.html)

11
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

XAMPP Control Panel


(https://www.apachefriends.org/index.html)
- Open XAMPP from your desktop.
- If there’s any prompt (like firewall) please choose ‘Allow’ always.
- Click the start button from Apache.
- Find XAMPP folder in Drive C:/XAMPP/htdocs
- Put your sample website folder there and run it in the browser by
typing http://localhost/<Name of the folder>
- You have successfully setup your PHP Development environment in
your local PC.

12
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
PHP Fundamentals
WEB APPLICATIONS DEVELOPMENT - CIT

Basic PHP Syntax

14
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

PHP Comments: Single-line comment

15
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

PHP Comments: Multiple-line comments

16
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

The PHP echo statements


- With PHP, there is a basic way to get output: echo

17
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

Creating (Declaring) PHP Variables


- In PHP, a variable starts with the $ sign, followed
by the name of the variable:

18
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

Functions
- The real power of PHP comes from its functions.

19
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN

You might also like