1 1 Xampp : Adalah salah satu paket aplikasi webserver yang dapat digunakan untuk keperluan membuat webserver pada komputer lokal, aplikasi yang terma...
Xampp : Adalah salah satu paket aplikasi webserver yang dapat digunakan untuk keperluan membuat webserver pada komputer lokal, aplikasi yang termasuk didalam paketnya yaitu : apache web server, php server, mysql server dan lainya. Download http://sourceforge.net/projects/xampp/
1. Unzip hasil download di drive C: 2. Jalankan “setup_xampp.bat” di direktori xampp. 3. Jalankan “xampp-control.exe”.
1. Buka file \xampp\php\php.ini 2. Hilangkan tanda ; pada baris-baris dibawah ini untuk mengaktifkan fitur �
error_reporting = E_ALL | E_NOTICE
�
extension=php_mysql.dll
�
extension=php_mysqli.dll
�
memory_limit = 128M
�
display_errors = On
�
post_max_size = 200M
3. Buka file \ xampp\apache\conf\httpd.conf 4. Hilangkan tanda # pada baris-baris dibawah ini untuk mengaktifkan fitur DOSEN PENGAMPU : INDRA GUNAWAN, ST., M.KOM., CEH., CHFI
5. Start PHP dan MYSQL server pada “ xampp-control.exe” 6. Buat folder “praktikum” pada “\xampp\htdocs\” 7. Taruh semua file web di direktori “praktikum”
London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.
Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium.
Apa itu PHP : PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. Source : http://www.w3schools.com/php
Our SQL tutorial will teach you how to use SQL to access and manipulate data in: MySQL, SQL Server, Access, Oracle, Sybase, DB2, and other database systems. Cara mengakses SQL Admin : http://Localhost/phpmyadmin Contoh 1. Tabel Mahasiswa No
NPM
Nama
Prodi_id
Email
Contoh 2. Table Prodi Id
nama
Timestamp
1
Teknik Industri
2
Teknik Informatika
Contoh 3. Menampilkan npm dan nama No
NPM
Nama
Contoh 4. Menampilkan nama mahasiswa dan jurusan no
nama
Jurusan
1 2
Contoh 5. Menampilkan nama mahasiswa yg prodinya Teknik Informatika
1. Copy joomla ke directory /xampp/htdocs/joomla 2. Unzip /extract joomla 3. Jalankan xampp server (xampp control panel.exe), pastikan apache dan mysql start warna hijau 4. Buat database dengan nama sembarang (contoh : joomla) melalui phpmyadmin di http://localhost/phpmyadmin 5. Panggil instalasi joomla http://localhost/joomla
Halaman admin dapat diakses di http://localhost/joomla/administrator Halaman web dapat diakses di http://localhost/joomla
Jika ingin membuat menu yang jika di klik menuju ke artikel tertentu, pilih konfigurasi seperti digambar dibawah ini. Atau sesuaikan dengan yang diinginkan dengan memilih pada menu item typeAdm
Untuk memilih template-template default yang telah disediakan joomla, klik menu extensionstemplate manager. Klik default pada template yang diinginkan Location Site : Template untuk halaman pengunjung Location Administrator : Template untuk halaman admin
Modul adalah fasilitas2 yang biasanya tampil di kanan dan kiri halaman web (contoh : modul search, last article, last comment, tag dll). Untuk mengaktifkan/menonaktifkan modul bisa diakses di menu Extensions-module manager Klik New untuk menambahkan modul-modul default lainnya yang telah disediakan joomla Jika modul yang diinginkan tidak tersedia, dapat di download di website joomla http://extensions.joomla.org
Plugin pada joomla mirip dengan modul yaitu script kecil yang berfungsi untuk melakukan pekerjaan2 tambahan yang tidak tersedia pada joomla. Perbedaan mendasar antara modul dan plugin yaitu, jika modul dapat dipindah2 posisi pada tampilan web, sedang plugin tidak bisa, contoh (plugin konversi Bahasa, plugin tombol social media pada setiap article, plugin text editor) Jika plugin2 yang dibutuhkan tidak tersedia, silahkan download di website joomla http://extensions.joomla.org
1. Extract / Unzip CodeIgniter-3.0.0.zip ke dalam /xampp/htdocs/codeigniter. 2. Ubah setingan pada file /codeigniter/application/config/config.php baris 20 $config['base_url'] = 'http://localhost/codeigniter/';
1. Ubah setingan pada file /codeigniter/application/config/routes.php �
Baris 52 menjelaskan bahwa file pertama yang dipanggil ketika codeigniter dijalankan yaitu ‘home.php’ pada folder controller $route['default_controller'] = 'main';
2. Buat file main.php pada folder /codeigniter/application/controller/ �
Function index adalah function pertama yang dipanggil ketika file home.php ini dipanggil
�
Baris 13 digunakan untuk memanggil file test.php, pada folder “view”
1. Buat file main.php pada direktori /codeigniter/application/controller. 2. Buat 5 file pada direktori /codeigniter/application/view. home.php kuliah.php kerja.php aboutme.php contact.php
Isi file /codeigniter/application/controller/main.php adalah sebagai berikut : home(); } public function home() { $this->load->view('home'); //memanggil view home.php } public function kuliah() { $this->load->view('kuliah'); //memanggil view kuliah.php } public function kerja() { $this->load->view('kerja'); //memanggil view kerja.php } public function aboutme() { $this->load->view('aboutme'); //memanggil view aboutme.php } public function contact() { $this->load->view('contact'); //memanggil view contact.php } DOSEN PENGAMPU : INDRA GUNAWAN, ST., M.KOM., CEH., CHFI
22
MODUL PRAKTIKUM PEMROGRAMAN WEB
23
}
Berikut adalah isi dari /codeigniter/application/view/home.php Website ku
Ini adalah web pertamaku dengan CodeIgniter Framework
Isi dari keempat file lainnya (kuliah.php, kerja.php, aboutme.php, contact.php) adalah sama tinggal diganti didalam div section nya disesuaikan kalimat paragrafnya. Buat folder /assets pada /codeigniter/, isinya style.css dan header.jpg (ambil dr pertemuan 4)
Halaman web yang akan dibuat terdiri 5 menu : Home, Tentang Kuliah, Tentang Kerja, About me, Contact
�
Pada sub bab 7.5 ini semua tulisan/content pada tiap2 halaman bersifat statis yang berasal dari script php/html.
�
Style/CSS yg digunakan berasal dari bootstrap (CSS Framework).
�
MVC yang terlibat yaitu Controller dan View.
Ada 12 entitas yang terlibat dalam pembahasan sub bab ini, yaitu � � � � � � � � � � �
main.php (controller) template.php (libraries) home.php (view) kuliah.php (view) kerja.php (view) contactus.php (view) aboutme.php (view) header.php(view/isinya berasal dari bootstrap) content.php (view/isinya berasal dari bootstrap) footer.php (view/isinya berasal dari bootstrap) container.php (view/isinya berasal dari bootstrap)
2. Template.php (Library) dibawah ini berfungsi untuk menangani templating/style pada website yang kita buat yang nantinya dikombinasikan dengan Bootstrap. CI=& get_instance(); $this->CI->load->helper('url'); $this->CI->load->view_data['base_url']=base_url(); } public function index() { $this->home(); } public function home(,$output=NULL) { //halaman utama $data[‘base_url’]=base_url(); $data['page_title']='Halaman Utama'; $data['h1']='
Selamat datang di websiteku
'; $data['content']=$this->CI->load->view('home',’’,true); $output['header']=$this->CI->load->view('header',$data,true); $output['content']=$this->CI->load->view('content',$data,true); $output['footer']=$this->CI->load->view('footer','',true); RETURN $output; } public function kuliah($output=NULL) { //halaman kuliah $data[‘base_url’]=base_url(); $data['page_title']='Halaman Kuliah'; $data['content']=$this->CI->load->view('kuliah',’’,true); $output['header']=$this->CI->load->view('header',$data,true); $output['content']=$this->CI->load->view('content',$data,true); $output['footer']=$this->CI->load->view('footer','',true); RETURN $output; } public function kerja($output=NULL) { //Halaman kerja $data[‘base_url’]=base_url(); $data['page_title']='Halaman Kerja'; $data['content']=$this->CI->load->view('kerja',’’,true); $output['header']=$this->CI->load->view('header',$data,true); $output['content']=$this->CI->load->view('content',$data,true); DOSEN PENGAMPU : INDRA GUNAWAN, ST., M.KOM., CEH., CHFI
public function aboutme($output=NULL) { // halaman aboutme $data[‘base_url’]=base_url(); $data['page_title']='Halaman Tentang Aku'; $data['content']=$this->CI->load->view('aboutme',’’,true); $output['header']=$this->CI->load->view('header',$data,true); $output['content']=$this->CI->load->view('content',$data,true); $output['footer']=$this->CI->load->view('footer','',true); RETURN $output; } public function contactus($output=NULL) { //Halaman Contact Us $data['page_title']='Halaman Kontak'; $data[‘base_url’]=base_url(); $data['content']=$this->CI->load->view('contactus',’’,true); $output['header']=$this->CI->load->view('header',$data,true); $output['content']=$this->CI->load->view('content',$data,true); $output['footer']=$this->CI->load->view('footer','',true); RETURN $output; } }
3. Buat file container.php pada direktori /codeigniter/application/view/container.php yg isinya seperti gambar dibawah ini � File ini berfungsi sebagai file yg bertugas untuk menggabungkan 3 file header.php, content.php serta footer.php menjadi satu tampilan website. Berikut isi file container.php
4. Isikan kalimat bebas pada masing2 file /views/home.php , /views/kuliah.php, /views/kerja.php, /views/contactus.php, /views/aboutme.php. Contohnya seperti dibawa ini
Ini halaman Home
5. Extract contoh template shym.zip di direktori /xampp/htdocs/codeigniter/assets DOSEN PENGAMPU : INDRA GUNAWAN, ST., M.KOM., CEH., CHFI
MODUL PRAKTIKUM PEMROGRAMAN WEB
28
6. Buka file index.html pada direktori /assets/index.html menggunakan browser, kemudian buka source code nya dgn cara klik kanan halaman web pilih view page source (mozilla). 7. Copy baris 1-94 dari source code diatas, kemudian pastekan ke /codeigniter/application/view/header.php. 8. Copy baris 95 sampai 582 dari source code diatas, kemudian pastekan ke /codeigniter/application/view/content.php. 9. Copy sisanya, baris 583 sampai 693 dari source code diatas, kemudian pastekan ke /codeigniter/application/view/footer.php. 10. Pada ketiga script diatas header.php, content.php, footer.php tambahkan “assets/” setelah src=” dan src=’, (gunakan fitur find replace dengan cara memencet Ctrl+H, isi find dengan src=’ isi replace dengan src=’assets’) 11. Tambahkan script dibawa ini pada baris 583 dibawah
12. Jika sudah benar maka hasil tampilannya sharusnya seperti dibawah ini :
13. Jika diperlukan hapus div-div, kalimat2 yang tidak diinginkan pada ketiga script diatas yang merupakan bawaan template, shingga hanya menyisakan bagian2 yang diinginkan saja.
<span data-scroll-reveal="wait 0.25s, then enter top and move 40px over 1s" >
Stylish Pictures
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia
<span data-scroll-reveal="wait 0.25s, then enter top and move 40px over 1s" >
Magnificent Colors
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia
<span data-scroll-reveal="wait 0.25s, then enter top and move 40px over 1s">
Retina Ready
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has.
<section class='shym-user'>
Best Pictures
It is a long established fact that a reader will be distracted by the readable content.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer.
Lorum Ipsum
Price:25$
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation +0123 456 70 80