Date post: | 19-Jun-2015 |
Category: | Documents |
View: | 1,606 times |
Download: | 2 times |
PHP Web DevelopmentInstalasi dan pengenalan PHP SQL dengan menggunakan MySQL Server PHP Scripting Array dan String Functions Integrasi PHP dan MySQL Session dan Cookies Handling File Uploads Shopping Cart
PHP Web Development
Page 1 of 60
Daftar IsiBagian 1 - Instalasi dan Pengenalan PHP ........................................................................................... 4 1.1 Instalasi PHP........................................................................................................ 4 1.2 Instalasi Apache Server 1.3.33 .............................................................................. 4 1.3 Instalasi MySQL Server ....................................................................................... 10 1.4 PHP Language Fundamental................................................................................ 10 1.4.1 HTML Tags .................................................................................................... 11 1.4.2 Variabel dalam PHP ........................................................................................ 18 1.4.3 Control Structure ............................................................................................ 18 1.4.4 Including PHP script........................................................................................ 19 Bagian 2 Language Fundamental (Lanjutan).................................................................................... 21 2.1 Function ............................................................................................................ 21 2.2 Array................................................................................................................. 22 2.3 Array Functions .................................................................................................. 23 2.3.1 count ............................................................................................................ 23 2.3.2 array_keys ..................................................................................................... 23 2.3.3 array_values .................................................................................................. 24 2.3.4 array_key_exists ............................................................................................ 24 2.3.5 in_array......................................................................................................... 24 2.3.6 array_splice ................................................................................................... 24 2.3.7 array_unique.................................................................................................. 25 2.3.8 array_filter..................................................................................................... 25 2.3.9 array_intersect ............................................................................................... 26 2.3.10 array_merge .............................................................................................. 26 2.4 String Functions ................................................................................................. 26 2.4.1 md5 .............................................................................................................. 26 2.4.2 sha1.............................................................................................................. 26 2.4.3 number_format .............................................................................................. 26 2.4.4 parse_str ....................................................................................................... 27 2.4.5 str_replace..................................................................................................... 27 2.4.6 str_ireplace.................................................................................................... 27 2.4.7 addslashes..................................................................................................... 27 2.4.8 stripslashes.................................................................................................... 27 2.4.9 strlen ............................................................................................................ 27 2.4.10 strtolower .................................................................................................. 27 2.4.11 strtoupper.................................................................................................. 27 2.4.12 substr........................................................................................................ 27 2.4.13 trim........................................................................................................... 28 2.4.14 sprintf ....................................................................................................... 28 2.4.15 sscanf........................................................................................................ 28 2.4.17 implode ..................................................................................................... 28 2.4.18 explode ..................................................................................................... 28 2.4.19 htmlspecialchars......................................................................................... 28 2.4.20 htmlentities................................................................................................ 29 2.4.21 html_entity_decode .................................................................................... 29 2.5 Class and Objects ............................................................................................... 29 Bagian 3 Using MySQL........................................................................................................... 30 3.1 Membuat database baru ..................................................................................... 31 3.2 Membuat tabel baru ........................................................................................... 31 3.3 Mengubah struktur tabel ..................................................................................... 32PHP Web Development Page 2 of 60
3.4 Memanipulasi record dalam tabel......................................................................... 32 3.5 Backup database/tabel to Script........................................................................... 32 Bagian 4 Integrating PHP dan MySQL........................................................................................... 37 4.2 menghitung jumlah record .................................................................................. 38 4.3 mengubah data di database ................................................................................ 38 Bagian 5 Data Manipulation ..................................................................................................... 40 Bagian 6 Paging dan Filtering................................................................................................... 50 6.1 Paging............................................................................................................... 50 6.2 Searching .......................................................................................................... 51 Bagian 7 Session dan Cookies .................................................................................................. 52 7.1 Session.............................................................................................................. 52 7.2 Cookies ............................................................................................................. 53 8.1 Baca file ............................................................................................................ 55 8.2 Tulis file ............................................................................................................ 55 8.3 Menampilkan isi direktori..................................................................................... 55 8.4 Mengubah nama file ........................................................................................... 55 8.5 Menghapus suatu file.......................................................................................... 56 8.6 Menampilkan file dengan berbagai format ............................................................ 56 8.7 Uploading files ................................................................................................... 56 Bagian 9 Shopping Cart ......................................................................................................... 58
PHP Web Development
Page 3 of 60
Bagian 1 - Instalasi dan Pengenalan PHP1.1 Instalasi PHP Langkah-langkah menginstal PHP 1. Copykan file php ke C:\PHP. Kemudian copy file php4ts.dll ke C:\windows\system32 2. Masuk ke C:\PHP, kemudian duplikatkan file php.ini-dist menjadi php.ini Kemudian rename file tersebut menjadi php.ini dan copykan ke C:\WINDOWS 1.2 Instalasi Apache Server 1.3.33 1. Instal Apache terlebih dahulu.
PHP Web Development
Page 4 of 60
2. Pilihlah mode Complete.
PHP Web Development
Page 5 of 60
3. Kemudian klik Next terus hingga proses instalasi dilakukan.
4. Tunggu hingga instalasi selesai.
Kemudian kita lanjutkan dengan setting sebagai berikut 5. Apache anda secara default terinstal di C:\Program Files\Apache Group\Apache Kemudian cari folder conf dan cek di dalamnya terdapat file httpd.conf, buka dengan menggunakan Notepad dan tambahkan 3 baris ini di bagian paling bawah : LoadModule php4_module c:/php/sapi/php4apache.dll AddModule mod_php4.c AddType application/x-httpd-php .php
PHP Web Development
Page 6 of 60
6. Restart apache. Masuk ke services.msc, dengan memilih Start > Run, kemudian ketik services.msc. Setelah itu restart Apache-nya.
P