0% found this document useful (0 votes)
17 views34 pages

Minggu Ke-2 Back-End Dan PHP

The document provides an overview of a back-end web development and PHP course being taught. The course objectives are to help students understand back-end web development concepts and explain the basics of the PHP programming language. The course covers topics such as variables, constants, data types, operators, branching and looping control structures. Examples and exercises are provided to help students learn PHP syntax and how to integrate PHP with HTML.

Uploaded by

Nadia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views34 pages

Minggu Ke-2 Back-End Dan PHP

The document provides an overview of a back-end web development and PHP course being taught. The course objectives are to help students understand back-end web development concepts and explain the basics of the PHP programming language. The course covers topics such as variables, constants, data types, operators, branching and looping control structures. Examples and exercises are provided to help students learn PHP syntax and how to integrate PHP with HTML.

Uploaded by

Nadia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Pendidikan Komputer

Fakultas Keguruan dan Ilmu Pendidikan


Universitas Lambung Mangkurat

BACK-END WEB DEVELOPMENT Oleh


Dr. Harja Santana Purba, M.Kom
DAN PHP Novan Alkaf B. S., S.Kom., M.T

Minggu ke-2: 28 Februari 2023


Capaian Pembelajaran
ØMahasiswa memahami konsep back-end web development
ØMahasiswa menjelaskan Dasar Bahasa Pemrograman PHP

Variable Constant Data Type

Operator Branching Looping


BACK-END WEB DEVELOPMENT
oThe back-end development is the web or application development that you can’t
“see” (server, database, etc.)
oA back-end developer is one who is responsible for server-side web application
logic and sees to the integration of the work front-end developers do.
oSome Of The Things Taken Care Of By Backend Developers Include:
oWriting server-side code. (PHP, Javascript, Java etc)
oWriting code to interact with a database ( MySQL, NoSQL)
oEnsuring that the server-side code is secure and free of vulnerabilities (Security).
oEnsuring that the server-side code is optimized enough to handle large volumes of traffic (Optimize)
oDeploying the code online so that other people can use your service (Hosting)
WEB SERVER
Øa web server: that responds to client requests (typically from a web browser) by providing resources
such as HTML documents. Web Server allows for web pages to be served when a user accesses
specific URLs on
a server HTTP REQUEST/METHOD
• GET
• POST
• PUT
• DELETE

Image 1. How Web Server Work


PHP INFORMATION*
v PHP: Hypertext Preprocessor was first developed by Rasmus Lerdorf in 1994
v PHP become backbone of several billion-dollar companies influencing how industry
works across the globe.

Facebook Wikipedia Tumblr Slack

Mailchimp Etsy Wordpress

v Over 39.5% of all websites on the Internet are run on WordPress.


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
ØPHP can encrypt data
BASIC TECH YOU WILL USE IN THIS COURSE
IDE: Visual Studi Code (VSC) Front-end: HTML, CSS, Javascript Back-end: PHP (Laravel)

Web Server: Apache DBMS: MySQL Web Server Package: XAMPP


1. VARIABLE
PHP has a few rules when it comes to variables:
Ø A variable must start with the $ sign, followed by the name
of the variable.
Ø A variable name must start with a letter or the underscore
character.
Ø A variable name cannot start with a number.
Ø A variable name can only contain alpha-numeric characters Image 2. PHP combine with HTML in .php file
and underscores (A-z, 0-9, and _ ).
Ø Variable names are case-sensitive ($pants and $PANTS are
two different variables).
1. VARIABLE (2)
oCamel Case: •Kebab Case •Snake Case
oMyName • nama-saya • nama_pertama
• RuangGuru • file-baru • Transaksi_peminjaman
• TransaksiPinjam • transaksi-pinjam • Alamat_rumah
• gitRepository
1. VARIABLE AND ECHO
Is This Correct ?

Image 2. How to use Variable


2. CONSTANT
oA constant is an identifier (name) for a
simple value. As the name suggests, that
value cannot change during the execution of
the script
oConstants are case-sensitive. By convention,
constant identifiers are always uppercase.
3. EXPRESSION
ØExpression: "anything that has a value".
ØWhen you type $a = 5, you're assigning 5 into $a. 5, obviously, has the
value 5, or in other words 5 is an expression with the value of 5 (in this
case, 5 is an integer constant).
3. DATA TYPE
PHP supports the following data types:
• String
• Integer
• Float (floating point numbers - also called double)
• Boolean
• Array
• Object
• NULL
• Resource
3. DATA TYPE-STRING: SINGLE QUOTE – DOUBLE QUOTE
3. DATA TYPE-STRING:INTEGER
3. DATA TYPE-STRING: FLOATING NUMBER
3. DATA TYPE-STRING: BOOLEAN
3. DATA TYPE-STRING: ARRAY
3. DATA TYPE-STRING: ARRAY
4. OPERATOR
4. OPERATOR
4. OPERATOR
4. OPERATOR
5. CONTROL STRUCKTURE: BRANCHING

IF ELSE

IF-ELSE SWITCH
5. CONTROL STRUCKTURE: BRANCHING-IF-ELSE
5. CONTROL STRUCKTURE: BRANCHING - SWITCH
6. CONTROL STRUCKTURE: LOOPING

WHILE Do-WHILE

FOR FOREACH
6. CONTROL STRUCKTURE: LOOPING-WHILE
6. CONTROL STRUCKTURE: LOOPING-DO WHILE
6. CONTROL STRUCKTURE: LOOPING-FOR
LATIHAN 1
Perusahaan telepon A memiliki rate sebagai
berikut:
­ Tarif dasar telepon Rp.30/menit
­ Setelah jam 6 sore s/d jam 12 malam
menjadi Rp75/menit
­ Semua telepon dikenakan pajak ppn 10%
dari total biaya
­ Buat program yang menerima inputwaktu
mulai (jam) dan waktu berakhir (jam). Hitung
­ Lama telpon (dalam jam dan menit),
­ Pajak,
­ Biaya telpon dan biaya telpon ditambah
pajak.
32
LATIHAN 2
Buatlah program menghitung barang dengan ketentuan berikut:

33
MINGGU DEPAN ?

FUNCTION dan ARRAY


DAFTAR PUSTAKA
ohttps://www.php.net/manual/en/
oInternet & World Wide Web How to Program, 5th Editon, Deitel Deitel Goldberg
oPHP 8 Basic, Gunnard Engeberth & Satej Kumar Sahu, Apress, 2023
oPro PHP 8 MVC, Christoper Pitt, Apress, 2021

You might also like