What is PHP?
PHP files can contain text, HTML, CSS, JavaScript, and PHP code
• PHP code are executed on the server, and the result is returned
to the browser as plain HTML
• PHP files have extension ".php"
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Chp 08 php (shared)
1. PEMROGRAMAN BERBASIS WEB
UNIVERSITAS TEKNOKRAT INDONESIA
FAKULTAS TEKNIK DAN ILMU KOMPUTER
YUSRA FERNANDO, S.KOM., M.KOM
by:
20192019
Web Base Programming
1
2. PHP (PHP: Hypertext Preprocessor)
UNIVERSITAS TEKNOKRAT INDONESIA
FAKULTAS TEKNIK DAN ILMU KOMPUTER
YUSRA FERNANDO, S.KOM., M.KOM
by:
20192019
server side scripting
2
4. PROFIL
Nama : Yusra Fernando, S.Kom., M.Kom.
Status : Menikah
Anak: Muhammad Ibrahim Hanif Fernando
Pendidikan : S1, Teknik Informatika/(Ti) (Teknokrat 2004)
S2, Ilmu Komputer/(Cs) (IPB 2012)
Email : yusra.fernando@teknokrat.ac.id
Pengalaman
Pekerjaan : Asisten Dosen STMIK TEKNOKRAT 2006-2008
Dosen STMIK TEKNOKRAT 2009 - 2017
Dosen UNIVERSITAS TEKNOKRAT INDONESIA 2017 – Sekarang
Tim Kerja Bidang Kemahasiswaan (2015-2017)
Wakil Dekan III FTIK (2017)
Tim Kerja Wakil Rektor III Bidang Kemahasiswaan (2017- 2019)
Wakil Dekan III FEB (2019)
No. Telepon : 0852 7920 9118 (sms, line, WA)
yusra.fernando@teknokrat.ac.id
+6252 7920 9118
+6252 7920 9118
Yusra Fernando, M.Kom
CONTACT ME
4
5. Objective Course
To get to know the server side scripting
To get to know the php script
To get to know the PHP variables and data types
5
8. What is PHP?
• PHP is an acronym for "PHP: Hypertext Preprocessor"
• PHP is a widely-used, open source scripting language
• PHP scripts are executed on the server
• PHP is free to download and use
8
9. What is a PHP File?
• PHP files can contain text, HTML, CSS, JavaScript, and PHP code
• PHP code are executed on the server, and the result is returned
to the browser as plain HTML
• PHP files have extension ".php"
9
10. 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
10
11. Why PHP?
• PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
• PHP is compatible with almost all servers used today (Apache, IIS, etc.)
• PHP supports a wide range of databases
• PHP is free. Download it from the official PHP resource: www.php.net
• PHP is easy to learn and runs efficiently on the server side
11
12. What Do I Need?
• To start using PHP, you can:
• Find a web host with PHP and MySQL support
• Install a web server on your own PC, and then install PHP and
MySQL
12
13. Set Up PHP on Your Own PC
• However, if your server does not support PHP, you must:
• install a web server
• install PHP
• install a database, such as MySQL
• The official PHP website (PHP.net) has installation instructions for
PHP:http://php.net/manual/en/install.php
13
14. The official PHP website (PHP.net) has installation instructions for
PHP:http://php.net/manual/en/install.php
14
16. 16
BEKERJA DENGAN PHP
• Dibutuhkan 3 buah software, yaitu :
• Web Server (Apache, IIS, PWS, Xitami, dll) untuk menjalankan PHP.
• Program PHP (PHP 4 atau PHP 5) untuk mengeksekusi script PHP.
• Database Server (MySQL, Oracle, Ms SQL Server, dll) untuk bekerja dengan
database.
17. 17
Yang Digunakan
Web Server Apache (http://www.apache.org)
PHP 4 (http://www.php.net)
Database Server MySQL (http://www.mysql.com)
18. 18
INSTALASI PHP
Apache, PHP, dan MySQL diinstal secara sendiri-sendiri, lalu
dikonfigurasi.
Menggunakan paket PHP installer :
XAMPP
EasyPHP
PHPTriad
AppServ
Paket PHP installer yang disarankan : AppServ atau XAMPP.
27. Basic PHP Syntax
• A PHP script can be placed anywhere in the document.
• A PHP script starts with <?php and ends with ?>:
27
28. The PHP echo Statement
Save file by typing: echo.php
28
29. PHP Case Sensitivity
In PHP, all keywords
(e.g. if, else, while, echo, etc.), classes,
functions, and user-defined functions are
NOT case-sensitive.
29
32. Creating (Declaring) PHP Variables
Example 01 Example 02
Save file by typing: var01.php Save file by typing: var02.php 32
0201
33. PHP 5 Form Handling
33
Save file by typing: form.php
03
34. PHP 5 Form Handling (continue)
34
Save file by typing: form.php
04
35. PHP Form Input Arithmatic
35
Save file by typing: form_aritmatic.php05
36. PHP Form Input Arithmatic (continue)
Save file by typing: result.php
36
06
37. Resume
37
PHP is an acronym for "PHP: Hypertext Preprocessor“
PHP files can contain text, HTML, CSS, JavaScript, and PHP code
PHP code are executed on the server, and the result is returned to the browser as
plain HTML
PHP files have extension ".php"
True False
$variable $var!able
$choice $-choice
$te98 $98te
$month_1 $month 1
• A PHP script starts with <?php and ends with ?>: