SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Downloaden Sie, um offline zu lesen
PEMROGRAMAN BERBASIS WEB
UNIVERSITAS TEKNOKRAT INDONESIA
FAKULTAS TEKNIK DAN ILMU KOMPUTER
YUSRA FERNANDO, S.KOM., M.KOM
by:
20192019
Web Base Programming
1
PHP (PHP: Hypertext Preprocessor)
UNIVERSITAS TEKNOKRAT INDONESIA
FAKULTAS TEKNIK DAN ILMU KOMPUTER
YUSRA FERNANDO, S.KOM., M.KOM
by:
20192019
server side scripting
2
3
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
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
Motivation
6
Introduction PHP
7
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
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
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
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
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
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
The official PHP website (PHP.net) has installation instructions for
PHP:http://php.net/manual/en/install.php
14
15
PHP Architecture
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
Yang Digunakan
 Web Server Apache (http://www.apache.org)
 PHP 4 (http://www.php.net)
 Database Server MySQL (http://www.mysql.com)
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.
19
PHP Editor
 Notepad
 Dreamweaver
 Zend Studio
 PHP Editor
20
Penulisan Script PHP
 Embedded Script
 Non Embedded Script
21
Embedded Script
 Script PHP diletakkan di antara tag-tag HTML.
 Contoh :
<html>
<head>
<title>Embedded Script</title>
</head>
<body>
<?php
echo "Ini adalah contoh embedded script";
?>
</body>
</html>
22
Non Embedded Script
 tag-tag HTML yang diletakkan di dalam script PHP. Contoh :
<?php
echo "<html>";
echo "<head>";
echo "<title>Non Embedded Script</title>";
echo "</head>";
echo "<body>";
echo "Ini adalah contoh non embedded script";
echo "</body>";
echo "</html>";
?>
23
Style Kode PHP
 Style Standar :
<?php
echo "Ini adalah contoh style PHP";
?>
 Short Style :
<?
echo "Ini adalah contoh short style";
?>
24
Style Kode PHP
 Style Script :
<script language='php'>
echo "Ini adalah style javascript";
</script>
 Style ASP :
<%
echo "Ini adalah contoh style asp";
%>
Get Started ..
UNIVERSITAS TEKNOKRAT INDONESIA
FAKULTAS TEKNIK DAN ILMU KOMPUTER
YUSRA FERNANDO, S.KOM., M.KOM
20192019
25
Create New Folder
Create new php-myName1.
2. php-myName
Create new php-myName
26
Basic PHP Syntax
• A PHP script can be placed anywhere in the document.
• A PHP script starts with <?php and ends with ?>:
27
The PHP echo Statement
Save file by typing: echo.php
28
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
PHP Case Sensitivity
Save file by typing: heloword.php
30
True False
$variable $var!able
$choice $-choice
$te98 $98te
$month_1 $month 1
PHP Variables
31
Creating (Declaring) PHP Variables
Example 01 Example 02
Save file by typing: var01.php Save file by typing: var02.php 32
0201
PHP 5 Form Handling
33
Save file by typing: form.php
03
PHP 5 Form Handling (continue)
34
Save file by typing: form.php
04
PHP Form Input Arithmatic
35
Save file by typing: form_aritmatic.php05
PHP Form Input Arithmatic (continue)
Save file by typing: result.php
36
06
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 ?>:
Exercise ..
UNIVERSITAS TEKNOKRAT INDONESIA
FAKULTAS TEKNIK DAN ILMU KOMPUTER
YUSRA FERNANDO, S.KOM., M.KOM
20192019
38
Next ….
39
Product Name : ….
Product Price : ….
Qty : ….
Discount (20%) : ….
Total Price : ….
Excersice
Exercise 1
40
Save file by name: F1_Aritmatika.php
Save file by name: Result_Aritmatika.php
01 02
Thank you ...
UNIVERSITAS TEKNOKRAT INDONESIA
FAKULTAS TEKNIK DAN ILMU KOMPUTER
YUSRA FERNANDO, S.KOM., M.KOM
20192019
41

Weitere ähnliche Inhalte

Was ist angesagt? (11)

Php presentation
Php presentationPhp presentation
Php presentation
 
Finalwordpress
FinalwordpressFinalwordpress
Finalwordpress
 
Php1
Php1Php1
Php1
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Word press
Word pressWord press
Word press
 
Spider Course Day 1
Spider Course Day 1Spider Course Day 1
Spider Course Day 1
 
Php 1
Php 1Php 1
Php 1
 
Php intro
Php introPhp intro
Php intro
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
 
Thinking of business website? Go for PHP or Wordpress
Thinking of business website? Go for PHP or WordpressThinking of business website? Go for PHP or Wordpress
Thinking of business website? Go for PHP or Wordpress
 
Php reports sumit
Php reports sumitPhp reports sumit
Php reports sumit
 

Ähnlich wie Chp 08 php (shared)

Php tutorial
Php tutorialPhp tutorial
Php tutorial
Niit
 
Php hypertext pre-processor
Php   hypertext pre-processorPhp   hypertext pre-processor
Php hypertext pre-processor
Siddique Ibrahim
 
Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!
Francesco Fullone
 

Ähnlich wie Chp 08 php (shared) (20)

Php unit i
Php unit i Php unit i
Php unit i
 
PHP LICTURES ..........
PHP LICTURES ..........PHP LICTURES ..........
PHP LICTURES ..........
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php hypertext pre-processor
Php   hypertext pre-processorPhp   hypertext pre-processor
Php hypertext pre-processor
 
Php introduction
Php introductionPhp introduction
Php introduction
 
PHP Hypertext Preprocessor
PHP Hypertext PreprocessorPHP Hypertext Preprocessor
PHP Hypertext Preprocessor
 
How PHP works
How PHP works How PHP works
How PHP works
 
INTRODUCTION TO PHP.ppt
INTRODUCTION TO PHP.pptINTRODUCTION TO PHP.ppt
INTRODUCTION TO PHP.ppt
 
Php Interview Questions
Php Interview QuestionsPhp Interview Questions
Php Interview Questions
 
Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!
 
Federico Feroldi Php In Yahoo
Federico Feroldi Php In YahooFederico Feroldi Php In Yahoo
Federico Feroldi Php In Yahoo
 
PHP Course and Training
PHP Course and Training PHP Course and Training
PHP Course and Training
 
Php Training in Chandigarh
Php Training in ChandigarhPhp Training in Chandigarh
Php Training in Chandigarh
 

Mehr von YUSRA FERNANDO

Chapter 3.3 css - tugas css (shared)
Chapter 3.3   css - tugas css (shared)Chapter 3.3   css - tugas css (shared)
Chapter 3.3 css - tugas css (shared)
YUSRA FERNANDO
 

Mehr von YUSRA FERNANDO (20)

Vs Code - Keyboard-Shortcuts-Windows.pdf
Vs Code - Keyboard-Shortcuts-Windows.pdfVs Code - Keyboard-Shortcuts-Windows.pdf
Vs Code - Keyboard-Shortcuts-Windows.pdf
 
Chp 03 - Software PTI - (Shared).pdf
Chp 03 - Software PTI - (Shared).pdfChp 03 - Software PTI - (Shared).pdf
Chp 03 - Software PTI - (Shared).pdf
 
Chp 04 - Hardware PTI - (Shared).pdf
Chp 04 - Hardware PTI - (Shared).pdfChp 04 - Hardware PTI - (Shared).pdf
Chp 04 - Hardware PTI - (Shared).pdf
 
7. DATA RESOURCE MANAGEMENT.pdf
7. DATA RESOURCE MANAGEMENT.pdf7. DATA RESOURCE MANAGEMENT.pdf
7. DATA RESOURCE MANAGEMENT.pdf
 
8. IT and Decision Making.pdf
8. IT and Decision Making.pdf8. IT and Decision Making.pdf
8. IT and Decision Making.pdf
 
06 - IT Infrastructure (shared).pdf
06 - IT Infrastructure (shared).pdf06 - IT Infrastructure (shared).pdf
06 - IT Infrastructure (shared).pdf
 
Fox, Richard - Information Technology _ An Introduction for Today’s Digital W...
Fox, Richard - Information Technology _ An Introduction for Today’s Digital W...Fox, Richard - Information Technology _ An Introduction for Today’s Digital W...
Fox, Richard - Information Technology _ An Introduction for Today’s Digital W...
 
Bab 1 pengantar desain web
Bab 1   pengantar desain webBab 1   pengantar desain web
Bab 1 pengantar desain web
 
Chapter 3.3 css - tugas css (shared)
Chapter 3.3   css - tugas css (shared)Chapter 3.3   css - tugas css (shared)
Chapter 3.3 css - tugas css (shared)
 
Javascript yusra 2021 (shared)
Javascript   yusra 2021 (shared)Javascript   yusra 2021 (shared)
Javascript yusra 2021 (shared)
 
3. latihan css 01 (shared)
3. latihan css   01 (shared)3. latihan css   01 (shared)
3. latihan css 01 (shared)
 
2 property css (shared)
2   property css (shared)2   property css (shared)
2 property css (shared)
 
Css pengenalan css
Css   pengenalan cssCss   pengenalan css
Css pengenalan css
 
Chapter 1 introduction html (shared)
Chapter 1   introduction html (shared)Chapter 1   introduction html (shared)
Chapter 1 introduction html (shared)
 
Chapter 00 introduction - web desain -(shared)
Chapter 00   introduction - web desain -(shared)Chapter 00   introduction - web desain -(shared)
Chapter 00 introduction - web desain -(shared)
 
Kepribadian dan Nilai
Kepribadian dan NilaiKepribadian dan Nilai
Kepribadian dan Nilai
 
Emosi dan Suasana Hati
Emosi dan Suasana HatiEmosi dan Suasana Hati
Emosi dan Suasana Hati
 
Sikap dan Kepuasan Kerja
Sikap dan Kepuasan KerjaSikap dan Kepuasan Kerja
Sikap dan Kepuasan Kerja
 
Konsep Dasar Perilaku Organisasi
Konsep Dasar Perilaku OrganisasiKonsep Dasar Perilaku Organisasi
Konsep Dasar Perilaku Organisasi
 
Konsep Dasar Perilaku Organisasi
Konsep Dasar Perilaku OrganisasiKonsep Dasar Perilaku Organisasi
Konsep Dasar Perilaku Organisasi
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
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
  • 3. 3
  • 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.
  • 19. 19 PHP Editor  Notepad  Dreamweaver  Zend Studio  PHP Editor
  • 20. 20 Penulisan Script PHP  Embedded Script  Non Embedded Script
  • 21. 21 Embedded Script  Script PHP diletakkan di antara tag-tag HTML.  Contoh : <html> <head> <title>Embedded Script</title> </head> <body> <?php echo "Ini adalah contoh embedded script"; ?> </body> </html>
  • 22. 22 Non Embedded Script  tag-tag HTML yang diletakkan di dalam script PHP. Contoh : <?php echo "<html>"; echo "<head>"; echo "<title>Non Embedded Script</title>"; echo "</head>"; echo "<body>"; echo "Ini adalah contoh non embedded script"; echo "</body>"; echo "</html>"; ?>
  • 23. 23 Style Kode PHP  Style Standar : <?php echo "Ini adalah contoh style PHP"; ?>  Short Style : <? echo "Ini adalah contoh short style"; ?>
  • 24. 24 Style Kode PHP  Style Script : <script language='php'> echo "Ini adalah style javascript"; </script>  Style ASP : <% echo "Ini adalah contoh style asp"; %>
  • 25. Get Started .. UNIVERSITAS TEKNOKRAT INDONESIA FAKULTAS TEKNIK DAN ILMU KOMPUTER YUSRA FERNANDO, S.KOM., M.KOM 20192019 25
  • 26. Create New Folder Create new php-myName1. 2. php-myName Create new php-myName 26
  • 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
  • 30. PHP Case Sensitivity Save file by typing: heloword.php 30
  • 31. True False $variable $var!able $choice $-choice $te98 $98te $month_1 $month 1 PHP Variables 31
  • 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 ?>:
  • 38. Exercise .. UNIVERSITAS TEKNOKRAT INDONESIA FAKULTAS TEKNIK DAN ILMU KOMPUTER YUSRA FERNANDO, S.KOM., M.KOM 20192019 38
  • 39. Next …. 39 Product Name : …. Product Price : …. Qty : …. Discount (20%) : …. Total Price : …. Excersice
  • 40. Exercise 1 40 Save file by name: F1_Aritmatika.php Save file by name: Result_Aritmatika.php 01 02
  • 41. Thank you ... UNIVERSITAS TEKNOKRAT INDONESIA FAKULTAS TEKNIK DAN ILMU KOMPUTER YUSRA FERNANDO, S.KOM., M.KOM 20192019 41