Tutorial PHP Dasar

Post on 28-Apr-2015

58 views 6 download

description

Tutorial PHP Dasar ini membahas tentang latihan-latihan php dari awal sampai ke penanganan file/folder

Transcript of Tutorial PHP Dasar

Modul Website - 2012 PNC

MODUL 2

P H P

1. INSTALLASI WEB SERVER2. STRUKTUR DASAR PHP3. STRUKTUR KONDISI DAN PERULANGAN4. PENANGANAN FORM5. ARRAY DAN FUNGSI6. PENANGAN STRING DAN TANGGAL7. FILE DAN DIREKTORI

1. INSTALLASI WEB SERVERa. Jalankan file installer XAMPP xampp-win32-x.x.x-installer.exeb. Akan ditampilkan window instalasi XAMPP. Pilih Next> untuk memulai proses

instalasic. Akan ditampilkan window lokasi tujuan instalasi (Destination Folder), pilih Next>

untuk meneruskan proses instalasid. Ceklist semua kemudian pilih Installe. Proses instalasi dimulaif. Pilih Finishg. Pilih “Yes”h. Tampil window XAMPP Control Paneli. Pengujian ketik “http://localhost” pada address bar web browser, jika berhasil

muncul tampilan seperti berikut:

Pilih bahasa yang ingin digunakan dan akan tampil halaman utama XAMPP seperti berikut:

ProNet Creative (PNC) Hal 1

Modul Website - 2012 PNC

2. STRUKTUR DASAR PHP

Nama file : hello.php

Hasilnya:

a. VariableNama file : variable.php

Hasilnya:

b. KonstantaNama file : konstanta.php

Hasilnya :

ProNet Creative (PNC) Hal 2

Modul Website - 2012 PNC

c. KomentarNama file : komentar.php

Hasilnya:

d. OperatorNama file : operator.php

Hasilnya:

Nama file : operator2.php

ProNet Creative (PNC) Hal 3

Modul Website - 2012 PNC

Hasilnya:

3. STRUKTUR KONDISI DAN PERULANGANa. IF dan IF...Else

Nama file : if.php

Hasilnya:

Nama file : if-else.php

Hasilnya:

ProNet Creative (PNC) Hal 4

Modul Website - 2012 PNC

Nama file : if-var.php

Hasilnya :

Nama file : if-khusus.php

Hasilnya:

Nama file : switch.php

ProNet Creative (PNC) Hal 5

Modul Website - 2012 PNC

Hasilnya :

b. Pengulangan (for, while, dowhile)Nama file : for.php

Hasilnya :

Nama file : while.php

Hasilnya:

ProNet Creative (PNC) Hal 6

Modul Website - 2012 PNC

Nama file : do-while.php

Hasilnya:

4. PENANGANAN FORMNama file : input1.php

Hasilnya:

Nama file : input2.php

ProNet Creative (PNC) Hal 7

Modul Website - 2012 PNC

Nama file : proses2.php

Hasilnya:

Nama file : input3.php dan proses3.phpUntuk praktek ini perbedaannya hanya di method, method asalnya “method=POST” di ubah menjadi “method=GET”Nama file : form4.php

Nama file : proses4.php

ProNet Creative (PNC) Hal 8

Modul Website - 2012 PNC

Hasilnya:

Nama file : form5.php

Nama file : proses5.php

Hasilnya:Isikan Username = raka , Password = diningrat

Jika, username & password kosong, username dan/password salah hasilnya:

Nama file : form6.php

ProNet Creative (PNC) Hal 9

Modul Website - 2012 PNC

Nama file : proses6.php

Hasilnya:

Nama file : form7.php

Nama file : proses7.php

ProNet Creative (PNC) Hal 10

Modul Website - 2012 PNC

Hasilnya:

Nama file : form8.php

Nama file : proses8.php

Hasilnya:

ProNet Creative (PNC) Hal 11

Modul Website - 2012 PNC

Nama file : form9.php

Nama file : proses9.php

Hasilnya:

5. ARRAY DAN FUNGSINama file : array1.php

ProNet Creative (PNC) Hal 12

Modul Website - 2012 PNC

Hasilnya:

Nama file : array2.php

Hasilnya:

Nama file : array3.php

Hasilnya:

Nama file : array4.php

ProNet Creative (PNC) Hal 13

Modul Website - 2012 PNC

Hasilnya:

Nama file : array5.php

Hasilnya:

Nama file : array6.php

ProNet Creative (PNC) Hal 14

Modul Website - 2012 PNC

Hasilnya:

Nama file : array7.php

ProNet Creative (PNC) Hal 15

Modul Website - 2012 PNC

Hasilnya:

Nama file : array8.php

ProNet Creative (PNC) Hal 16

Modul Website - 2012 PNC

Hasilnya:

Nama file : array9.php

ProNet Creative (PNC) Hal 17

Modul Website - 2012 PNC

Hasilnya:

Nama file : array10.php

Hasilnya:

Nama file : fungsi1.php

ProNet Creative (PNC) Hal 18

Modul Website - 2012 PNC

Hasilnya:

.... 99

Nama file : fungsi2.php

Hasilnya:

Nama file : fungsi3.php

Hasilnya:

Nama file : fungsi4.php

ProNet Creative (PNC) Hal 19

Modul Website - 2012 PNC

Hasilnya:

Nama file : fungsi5.php

Hasilnya:

Nama file : fungsi6.php

Hasilnya:

... dstNama file : fungsi7.php

ProNet Creative (PNC) Hal 20

Modul Website - 2012 PNC

Hasilnya:

6. PENANGANAN STRING DAN TANGGALa. String

Nama file : string1.php

Hasilnya:

Nama file: string2.php

Hasilnya:

b. TanggalNama file: tanggal1.php

ProNet Creative (PNC) Hal 21

Modul Website - 2012 PNC

Hasilnya:

Nama file: tanggal2.php

Hasilnya:

7. FILE DAN DIREKTORIa. File

Nama file: file1.php

Hasilnya:

Nama file: file2.php

ProNet Creative (PNC) Hal 22

Modul Website - 2012 PNC

Hasilnya:

b. Direktori Nama file: dir1.php

Hasilnya:

ProNet Creative (PNC) Hal 23