SlideShare a Scribd company logo
MEMBUAT APLIKASI
DENGAN PHP

Agus Supriatna
Microsoft Certified Professional Developer
www.asupna.com
@agusSupark
asupriatna@teken.co.id
PURPOSE
Dengan pesatnya perkembangan Internet dan World Wide Web ada
peningkatan permintaan untuk pengembang dengan kemampuan untuk
melakukan manipulasi Web data lebih maju.
Siswa yang terlibat dalam pengembangan Web statis membutuhkan teknik
untuk memanipulasi konten Web sehingga web menjadi dinamis.
Tujuan dari program PHP adalah alat dan teknik untuk mengembangkan lebih
dinamis Web berbasis aplikasi, dengan manipulasi data yang disimpan dalam
database online
CONTENT
1.

Introduction

2.

Working with HTML

3.

Getting Started With Variables

4.

Operators

5.

Control Structure

6.

Arrays in PHP

7.

Functions

8.

Web Application
1. INTRODUCTION
PHP (Personal Home Page Tools) created by Rasmus Lerdorf In 1994, umumnya
digunakan untuk:
1.

Melakukan fungsi sistem: membuat, membuka, membaca dari, menulis, dan
menutup file di sistem, menjalankan perintah sistem, membuat direktori, dan
mengubah hak akses.

2.

Mengumpulkan data dari bentuk: menyimpan data ke file, mengirim data melalui email, mengembalikan data dimanipulasi untuk pengguna.

3.

Akses database dan menghasilkan konten on-the-fly, atau membuat antarmuka Web
untuk menambahkan, menghapus, dan memodifikasi elemen-elemen dalam
database Anda.

4.

Mengatur cookie dan variabel akses.

5.

Otentikasi pengguna PHP untuk membatasi akses ke bagian situs Web Anda.

6.

Membuat gambar on-the-fly.

7.

Enkripsi data.
INSTALL
Xampp (Apache Web Server, PHP, Mysql)
Front end for the MySQL database server
PHP Editor Eclipse, Notepad++
Membuat aplikasi dengan php
2. WORKING WITH HTML
<html>

<head><title>PHP Test</title></head>
<body>
<?php echo '<p>Hello World Saya Menggunakan PHP</p>'; ?>
<table>
<tr> <th>Nama</th><th>Umur</th></tr>
<tr><td>Bagus</td><td>17 tahun</td></tr>
</table>

</body>
</html>
2. WORKING WITH HTML
FORM
<form action=“handleForm.php" method="post">
<p>Nama: <input type="text" name=“Nama" /></p>
<p>Umur: <input type="text" name=“Umur" /></p>
<p>Komentar: <textarea rows=5 cols=40 name=“Komentar”> </textarea>
<p><input type="submit" name=“Simpan” value=“simpan”/>
<input type=“reset" name=“Clear” value=“Hapus Form”/>
</p>
</form>
COMMENTING YOUR CODE
1. HTML comments <!—and —>tags.
<!— logo graphic goes here —>
2. PHP comments // ; # ; /* and */
// this is a comment in PHP code
# This is shell-style style comment
/* This begins a C-style comment that runs
onto two lines */
3. GETTING STARTED WITH
VARIABLES
1. Variable Scalar, berisi satu nilai dalam satu waktu
• Integers
• floating poin numbers (floats/doubles).
• Strings.Text and/or numeric yg ada diantara double quotes (" ") or
single quotes (' ')
2. Variable Arrays, berisi sejumlah nilai dan array lain sehingga membentuk
multidimensi array
3. HTML Variabel, variable yg didapat dari HTML form atau URL link
4. Supperglobal Variable, variable yg sudah ada di php engine
VARIABLE SCOPE
1.
2.

Sigle Scope
Global Scope dan Local Scope

<?php
var $r = 'I am r.';
class foo {
var $bar = 'I am bar.';
var $arr = array('I am A.', 'I am B.', 'I am
C.');
}
$foo = new foo();
$bar = 'bar';
$baz = array('foo', 'bar', 'baz', 'quux');
echo $foo->$bar . "n";
echo $foo->$baz[1] . "n";
?>
SUPERGLOBAL VARIABLES
$GLOBALS
$_SERVER
$_GET
$_POST
$_FILES
$_COOKIE
$_SESSION

$_REQUEST
$_ENV
4. OPERATORS
Assignment Operator :
 =, += , -= , and .=

Arithmetic Operator:
 Addition(+), subtraction(-), multiplication(*), division(/), modulus(%)

Comparison Operator
 equal to (==), not equal to (!=), greater than (>), less than(<), greater than or equal to (>=),
less than or equal to (<=)
 (&&) and; (||) or ; NOT (!).
5. CONTROL STRUCTURE
if

continue

else

switch

elseif/else if

declare

while

return

do-while

require

for

include

foreach

require_once

break

include_once

goto
ARRAYS IN PHP
<?php
$array = array(
"foo" => "bar",
"bar" => "foo",
100 => -100,
-100 => 100,
);
var_dump($array);
?>

count(),
is_array(),
explode(),
implode(),
split(),
preg_split(),
unset()
Isset()
print_r()
var_dump()
7. FUNCTIONS
function function_name($arg_1, $arg_2, ..., $arg_n)
{
code_line1;
code_line2;
code_line3;
return ($value); //stops execution of the function and returns its argument as
the value at the point where the function was called.
}
8. WEB APPLICATION
1.

Database MySQL

2.

Creating and Populating Database

3.

User Authentication
BEST PHP FRAMEWORKS
FOR 2014
LINK
http://php.net
http://www.phpclasses.org
http://www.w3schools.com/
https://www.colorschemer.com/online.html

More Related Content

DOC
modul PHP
DOCX
Tugas 1300631003
PDF
Laporan_PHP-MySQL
DOCX
Pengaplikasian halaman Log-in berbasis MySQL
DOCX
DOCX
PPTX
PDO (php data object)
PPT
P webfb
modul PHP
Tugas 1300631003
Laporan_PHP-MySQL
Pengaplikasian halaman Log-in berbasis MySQL
PDO (php data object)
P webfb

What's hot (7)

PDF
Praktikum 3 WML, PHP,dan MySQL
PPTX
1211510555 irfan adi rifangga tugas7_ku
PPTX
Superglobals dan session pada php
PPTX
Berkenalan dengan bahasa php pemrograman web
DOCX
Mengatasi apache xampp yang tidak bisa berjalan
PPTX
Tugas7 ki-0316-rekweb
Praktikum 3 WML, PHP,dan MySQL
1211510555 irfan adi rifangga tugas7_ku
Superglobals dan session pada php
Berkenalan dengan bahasa php pemrograman web
Mengatasi apache xampp yang tidak bisa berjalan
Tugas7 ki-0316-rekweb
Ad

Viewers also liked (8)

PPTX
PLANTILLAS
PPTX
Presentation1.personal strategic plannig
PPTX
Asamblea Merka Chapa Chaps
PPTX
Christoph Tank, audioguide.me, Local Web Conference 2014
PDF
Dr. Peter Ruppel, bitplaces, Local Web Conference 2014
PPTX
MY PROFILE
PPTX
Padrino cooperativapptx
PPT
Familias de instrumentos
PLANTILLAS
Presentation1.personal strategic plannig
Asamblea Merka Chapa Chaps
Christoph Tank, audioguide.me, Local Web Conference 2014
Dr. Peter Ruppel, bitplaces, Local Web Conference 2014
MY PROFILE
Padrino cooperativapptx
Familias de instrumentos
Ad

Similar to Membuat aplikasi dengan php (20)

DOCX
Belajar PHP
PDF
10 pemrograman internet php (2)
PDF
PROGRESS - Belajar PHP #1
PPT
Pertemuan 8
PPTX
PHP merupakan bahasa script yang biasa digunakan untuk web development
DOCX
pemrograman php ii
PDF
Materi php1.1
PDF
Webprograming
PDF
Web programming
PDF
W E B P R O G R A M M I N G
PDF
Modul php 1
PPTX
10_Dasar_PHP.pptx
PDF
Modul praktikum algoritma
PDF
Dasar PHP
PDF
Belajar php (pemula dasar)
PDF
PPT Pertemuan 05 Junior Web Developer (Menerapkan Perintah Eksekusi Bahasa Pe...
PDF
WEB II PHP 01
DOC
Php mysq l - siapa - takut
PPTX
Php kel23
PDF
Pengertian dan fungsi dalam pemrograman web
Belajar PHP
10 pemrograman internet php (2)
PROGRESS - Belajar PHP #1
Pertemuan 8
PHP merupakan bahasa script yang biasa digunakan untuk web development
pemrograman php ii
Materi php1.1
Webprograming
Web programming
W E B P R O G R A M M I N G
Modul php 1
10_Dasar_PHP.pptx
Modul praktikum algoritma
Dasar PHP
Belajar php (pemula dasar)
PPT Pertemuan 05 Junior Web Developer (Menerapkan Perintah Eksekusi Bahasa Pe...
WEB II PHP 01
Php mysq l - siapa - takut
Php kel23
Pengertian dan fungsi dalam pemrograman web

Recently uploaded (20)

PDF
Materi Seminar AITalks AI dan Suku Digital
PDF
KASUS_INKUIRI_KOLABORATIF_KELAS_BAWAH-ISI-ARNI.pdf
DOCX
Modul Ajar Deep Learning Prakarya Kerajinan Kelas 12 SMA Terbaru 2025
PPTX
PPT MATERI KODING DAN KECERDASAN ARTIFISIAL UNTUK PEMBELAJARAN
PDF
INSTRUMEN IMPLEMENTASI DAN REFLEKSI PERENCANAAN PEMBELAJARAN-ARNI.pdf
PDF
PPT Resources Seminar AITalks: AI dan Konseling GPT
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 12 SMA Terbaru 2025
PPTX
PENGIMBASAN PEMBELAJARAN MENDALAM (DEEP LEARNING)
PPTX
PPT SURAT AL FIL LOMBA MAPSI SEKOLAH DASAR
PPSX
Teknik Trading Selang Seling Yang Dapat Digunakan Untuk Trading Manual Maupun...
PDF
Deck Rumah Pendidikan untuk Mendukung Program Prioritas Kemendikdasmen.pdf
DOCX
Modul Ajar Deep Learning PKWU Rekayasa Kelas 12 SMA Terbaru 2025
PPTX
Presentasi_Pembelajaran_Mendalam_Lengkap.pptx
DOCX
Modul Ajar Pembelajaran Mendalam Senbud Seni Tari Kelas XII Terbaru 2025
PPTX
Keterbatasan-Fasilitas-dalam-Mengajar-KKA.pptx
PPTX
PPT Kurikulum Berbasis Cinta tahun 2025.
PPTX
Pancasila: fondasi peradaban dan kebudayaan berkelanjutan
DOCX
Modul Ajar Deep Learning PJOK Kelas 12 SMA Terbaru 2025
DOCX
Modul Ajar Pembelajaran Mendalam Senbud Seni Teater Kelas XII Terbaru 2025
PPT
Teknologi-Pangan-Pertemuan-820728132309-.ppt
Materi Seminar AITalks AI dan Suku Digital
KASUS_INKUIRI_KOLABORATIF_KELAS_BAWAH-ISI-ARNI.pdf
Modul Ajar Deep Learning Prakarya Kerajinan Kelas 12 SMA Terbaru 2025
PPT MATERI KODING DAN KECERDASAN ARTIFISIAL UNTUK PEMBELAJARAN
INSTRUMEN IMPLEMENTASI DAN REFLEKSI PERENCANAAN PEMBELAJARAN-ARNI.pdf
PPT Resources Seminar AITalks: AI dan Konseling GPT
Modul Ajar Deep Learning Bahasa Inggris Kelas 12 SMA Terbaru 2025
PENGIMBASAN PEMBELAJARAN MENDALAM (DEEP LEARNING)
PPT SURAT AL FIL LOMBA MAPSI SEKOLAH DASAR
Teknik Trading Selang Seling Yang Dapat Digunakan Untuk Trading Manual Maupun...
Deck Rumah Pendidikan untuk Mendukung Program Prioritas Kemendikdasmen.pdf
Modul Ajar Deep Learning PKWU Rekayasa Kelas 12 SMA Terbaru 2025
Presentasi_Pembelajaran_Mendalam_Lengkap.pptx
Modul Ajar Pembelajaran Mendalam Senbud Seni Tari Kelas XII Terbaru 2025
Keterbatasan-Fasilitas-dalam-Mengajar-KKA.pptx
PPT Kurikulum Berbasis Cinta tahun 2025.
Pancasila: fondasi peradaban dan kebudayaan berkelanjutan
Modul Ajar Deep Learning PJOK Kelas 12 SMA Terbaru 2025
Modul Ajar Pembelajaran Mendalam Senbud Seni Teater Kelas XII Terbaru 2025
Teknologi-Pangan-Pertemuan-820728132309-.ppt

Membuat aplikasi dengan php

  • 1. MEMBUAT APLIKASI DENGAN PHP Agus Supriatna Microsoft Certified Professional Developer www.asupna.com @agusSupark asupriatna@teken.co.id
  • 2. PURPOSE Dengan pesatnya perkembangan Internet dan World Wide Web ada peningkatan permintaan untuk pengembang dengan kemampuan untuk melakukan manipulasi Web data lebih maju. Siswa yang terlibat dalam pengembangan Web statis membutuhkan teknik untuk memanipulasi konten Web sehingga web menjadi dinamis. Tujuan dari program PHP adalah alat dan teknik untuk mengembangkan lebih dinamis Web berbasis aplikasi, dengan manipulasi data yang disimpan dalam database online
  • 3. CONTENT 1. Introduction 2. Working with HTML 3. Getting Started With Variables 4. Operators 5. Control Structure 6. Arrays in PHP 7. Functions 8. Web Application
  • 4. 1. INTRODUCTION PHP (Personal Home Page Tools) created by Rasmus Lerdorf In 1994, umumnya digunakan untuk: 1. Melakukan fungsi sistem: membuat, membuka, membaca dari, menulis, dan menutup file di sistem, menjalankan perintah sistem, membuat direktori, dan mengubah hak akses. 2. Mengumpulkan data dari bentuk: menyimpan data ke file, mengirim data melalui email, mengembalikan data dimanipulasi untuk pengguna. 3. Akses database dan menghasilkan konten on-the-fly, atau membuat antarmuka Web untuk menambahkan, menghapus, dan memodifikasi elemen-elemen dalam database Anda. 4. Mengatur cookie dan variabel akses. 5. Otentikasi pengguna PHP untuk membatasi akses ke bagian situs Web Anda. 6. Membuat gambar on-the-fly. 7. Enkripsi data.
  • 5. INSTALL Xampp (Apache Web Server, PHP, Mysql) Front end for the MySQL database server PHP Editor Eclipse, Notepad++
  • 7. 2. WORKING WITH HTML <html> <head><title>PHP Test</title></head> <body> <?php echo '<p>Hello World Saya Menggunakan PHP</p>'; ?> <table> <tr> <th>Nama</th><th>Umur</th></tr> <tr><td>Bagus</td><td>17 tahun</td></tr> </table> </body> </html>
  • 8. 2. WORKING WITH HTML FORM <form action=“handleForm.php" method="post"> <p>Nama: <input type="text" name=“Nama" /></p> <p>Umur: <input type="text" name=“Umur" /></p> <p>Komentar: <textarea rows=5 cols=40 name=“Komentar”> </textarea> <p><input type="submit" name=“Simpan” value=“simpan”/> <input type=“reset" name=“Clear” value=“Hapus Form”/> </p> </form>
  • 9. COMMENTING YOUR CODE 1. HTML comments <!—and —>tags. <!— logo graphic goes here —> 2. PHP comments // ; # ; /* and */ // this is a comment in PHP code # This is shell-style style comment /* This begins a C-style comment that runs onto two lines */
  • 10. 3. GETTING STARTED WITH VARIABLES 1. Variable Scalar, berisi satu nilai dalam satu waktu • Integers • floating poin numbers (floats/doubles). • Strings.Text and/or numeric yg ada diantara double quotes (" ") or single quotes (' ') 2. Variable Arrays, berisi sejumlah nilai dan array lain sehingga membentuk multidimensi array 3. HTML Variabel, variable yg didapat dari HTML form atau URL link 4. Supperglobal Variable, variable yg sudah ada di php engine
  • 11. VARIABLE SCOPE 1. 2. Sigle Scope Global Scope dan Local Scope <?php var $r = 'I am r.'; class foo { var $bar = 'I am bar.'; var $arr = array('I am A.', 'I am B.', 'I am C.'); } $foo = new foo(); $bar = 'bar'; $baz = array('foo', 'bar', 'baz', 'quux'); echo $foo->$bar . "n"; echo $foo->$baz[1] . "n"; ?>
  • 13. 4. OPERATORS Assignment Operator :  =, += , -= , and .= Arithmetic Operator:  Addition(+), subtraction(-), multiplication(*), division(/), modulus(%) Comparison Operator  equal to (==), not equal to (!=), greater than (>), less than(<), greater than or equal to (>=), less than or equal to (<=)  (&&) and; (||) or ; NOT (!).
  • 14. 5. CONTROL STRUCTURE if continue else switch elseif/else if declare while return do-while require for include foreach require_once break include_once goto
  • 15. ARRAYS IN PHP <?php $array = array( "foo" => "bar", "bar" => "foo", 100 => -100, -100 => 100, ); var_dump($array); ?> count(), is_array(), explode(), implode(), split(), preg_split(), unset() Isset() print_r() var_dump()
  • 16. 7. FUNCTIONS function function_name($arg_1, $arg_2, ..., $arg_n) { code_line1; code_line2; code_line3; return ($value); //stops execution of the function and returns its argument as the value at the point where the function was called. }
  • 17. 8. WEB APPLICATION 1. Database MySQL 2. Creating and Populating Database 3. User Authentication

Editor's Notes

  • #3: /tujuan
  • #4: requirementsPre-knowledge on the development of static Web based applications (HTML). Internet access to the course material, e-mail facility and discussion forum on the course Web site.
  • #6: Go to Control Panel &gt; Administrative Tools &gt; ServicesFind ”World Wide Web Publishing Service”Right click and select “Stop”Right click and select “Properties”, then change “Startup type” to “Manual”
  • #8: Hello.phpHello.html
  • #10: Entering comments in documents helps you (and others who might have to edit your document later) keep track of areas of large documents.
  • #13: &lt;?php $browser_type = getenv(&quot;HTTP_USER_AGENT&quot;); if (preg_match(&quot;/MSIE/i&quot;, &quot;$browser_type&quot;)) { echo &quot;Using MSIE.&quot;; } else if (preg_match(&quot;/Mozilla/i&quot;, &quot;$browser_type&quot;)) { echo &quot;Using Netscape.&quot;; } else { echo &quot;$browser_type&quot;; }?&gt;
  • #14: $ex += 1; // Assigns the value of ($ex + 1) to $ex. // If $ex = 2, then the value of ($ex += 1) is 3.$ex -= 1; // Assigns the value of ($ex - 1) to $ex. // If $ex = 2, then the value of ($ex -= 1) is 1.$ex .= &quot;coffee&quot;; // Concatenates (adds to) a string. If $ex = &quot;I like” // then the value of ($ex .= &quot;coffee&quot;) is &quot;I likeArithmatic$c = $a + $b; // $c = 9$c = $a - $b; // $c = 1$c = $a * $b; // $c = 20$c = $a / $b; // $c = 1.25$c = $a % $b; // $c = 1In the following examples, $a = 5and $b = 4.• Is $a == $b?No; 5 does not equal 4. The comparison is FALSE.• Is $a != $b?Yes; 5 does not equal 4. The comparison is TRUE.• Is $a &gt; $b?Yes; 5 is greater than 4. The comparison is TRUE.• Is $a &lt; $b?No; 5 is not less than 4. The comparison is FALSE.• Is $a &gt;= $b?Yes; although 5 does not equal 4, 5 is greater than 4. The comparison is TRUE.• Is $a &lt;= $b?No; 5 does not equal 4, and 5 is not less than 4. The comparison is FALSE.Logical// secret number 5if ($guess == &quot;5&quot;) { echo &quot;That&apos;s the right number!&quot;;} else { echo &quot;Sorry. Bad guess.&quot;;}$drink1 = &quot;coffee&quot;;$drink2 = &quot;milk&quot;; if (($drink1 == &quot;coffee&quot;) || ($drink2 == &quot;coffee&quot;)) { echo &quot;I&apos;m happy!&quot;; } else { echo &quot;I still need caffeine.&quot;; }&lt;?php $price = 10.00; $sales_tax = .0825; $quantity = 4; $sub_total = $price * $quantity; $sales_tax_amount = $sub_total * $sales_tax; $grand_total = $sub_total + $sales_tax_amount; echo &quot;&lt;P&gt;You ordered $quantity bags of coffee.&lt;/p&gt;&quot;; echo &quot;&lt;P&gt;Bags of coffee are $price each.&lt;/p&gt;&quot;; echo &quot;&lt;P&gt;Your subtotal is $sub_total.&lt;/p&gt;&quot;; echo &quot;&lt;P&gt;Sales tax is $sales_tax in this location.&lt;/p&gt;&quot;; echo &quot;&lt;P&gt;$sales_tax_amount has been added to your order.&lt;/p&gt;&quot;; echo &quot;&lt;P&gt;You owe $grand_total for your coffee.&lt;/p&gt;&quot;;?&gt;
  • #15: &lt;?php/** This is an array with some data we want to modify* when running through the for loop.*/$people = array(array(&apos;name&apos; =&gt; &apos;Kalle&apos;, &apos;salt&apos; =&gt; 856412),array(&apos;name&apos; =&gt; &apos;Pierre&apos;, &apos;salt&apos; =&gt; 215863));for($i = 0; $i &lt; count($people); ++$i) {$people[$i][&apos;salt&apos;] = mt_rand(000000, 999999);}?&gt;
  • #16: Var_dump()Print_r()&lt;?php// Create a simple array.$array = array(1, 2, 3, 4, 5);print_r($array);// Now delete every item, but leave the array itself intact:foreach ($array as $i =&gt; $value) {unset($array[$i]);}print_r($array);// Append an item (note that the new key is 5, instead of 0).$array[] = 6;print_r($array);// Re-index:$array = array_values($array);$array[] = 7;print_r($array);?&gt;
  • #18: Php connect to database
  • #19: http://www.sitepoint.com/best-php-frameworks-2014/