PEMROGRAMAN WEB - digital4rainsick.files.wordpress.com file08.03.2016 · CuriculumVitae •...

17
PEMROGRAMAN WEB Indra Gunawan, ST., M.Kom., CEH., CHFI

Transcript of PEMROGRAMAN WEB - digital4rainsick.files.wordpress.com file08.03.2016 · CuriculumVitae •...

PEMROGRAMAN WEB

Indra Gunawan, ST., M.Kom., CEH., CHFI

Curiculum Vitae• Pendidikan :

• S1 Teknik Informatika, Minat Studi Kecerdasarn Buatan, 2007, Universitas Islam Indonesia YogyakartaSkripsi : Membuat Aplikasi Algoritma Genetika utk menyelesaikan Knapsack Problem menggunakan Vb.Net

• S2 Teknik informatika, Minat Studi Digital Forensic, 2014, Cumlaude, Universitas Islam Indonesia YogyakartaThesis : Membangun Aplikasi I-Polink (Indonesian Police Link) yaitu Knowledge Management untuk membantuinvestigasi forensika digital pada Laboratorium Digital Forensic Mabes Polri.

• Pengalaman Kerja :• Software Konsultan +- 4 tahun, 2011, Jakarta dan Batam, telah melakukan implementasi di +- 30 an perusahaan di

Jakarta, Bandung, Denpasar, Pekanbaru dan Batam.• Founder of Ex-java Technologies, 2011-2012, Batam, mempunyai client di pemerintahan, perusahaan lokal

maupun perusahaan asing di Batam.

• International Certification:• Computer Ethical Hacking, ECCouncil.• Computer Hacking Forensic Investigator, ECCouncil.• Cisco Networking Academy Program, Cisco.

CONTACT PERSON

• Email : [email protected]• HP / WA : 0857 66666 148

• PIN : 7EC491F9• Blog : http://digital4rainsick.wordpress.com

• Modul silahkan download di KelasOnline/Elearning

ATURAN DAN PENILAIAN

Syarat Ujian UTS : Kehadiran 50%

Syarat Ujian UAS : Kehadiran 50%

Unsur Penilaian :

• Kehadiran : 20%• Tugas : 30%• UTS : 25%• UAS : 25%

Range Nilai :

86 -100 = A71 - 85 = B56 - 70 = C41 – 55 = D<= 40 = E

REFERENSI

• Pratama, Widhi Nugraha, Antonius, 2010, “CodeIgniter : Cara MudahMembangun Aplikasi PHP”, Media Kita - Jakarta.

• http://www.w3schools.com• http://www.pivoteast.com/open-discussion-php-raw-vs-php-frameworks/

• http://www.noupe.com/development/discussing-php-frameworks.html• http://www.phpandstuff.com/articles/top-10-reasons-why-you-should-use-a-

php-framework• https://ellislab.com/codeigniter/user-guide/

OUTLINE MATERI

• 1. Introduction• 2. Server-side & Client-side programming • 3. HTML Language• 4. CSS Cascading Style Sheets• 5. Native CSS vs Framework CSS• 6/7 . PHP Personal Home Page• 8. Native PHP vs Framework PHP• 9/10. RDBMS MYSQL• 11/12. CodeIgniter PHP Framework• 13. Security Threats• 14. Securing www• 15/16. Web Server & Hosting

CODEIGNITERCONTROLLER

• Controllers are the heart of your application, as they determine how HTTP requests should be handled.• A Controller is simply a class file that is named in a way that can be associated with a URI.

example.com/blog/

• In the above example, CodeIgniter would attempt to find a controller named Blog.php and load it.• When a controller’s name matches the first segment of a URI, it will be loaded.

<?phpclass Blog extends CI_Controller {

public function index(){

echo 'Hello World!';}

}

• The file must be called ‘Blog.php’, with a capital ‘B’.• Then save the file to your application/controllers/ directory.

CODEIGNITERCONTROLLER

<?phpclass Blog extends CI_Controller {

public function index(){

echo 'Hello World!';}

public function comments(){

echo 'Look at this!';}

}

localhost/index.php/blog/comments/

• The yellow color is controller name• The blue color is function name of controller

CODEIGNITER

• DEFINING DEFAULT CONTROLLER

• CodeIgniter can be told to load a default controller when a URI is not present, as will be the case when only your site root URL is requested. To specify a default controller, open your application/config/routes.php file and set this variable:

$route['default_controller'] = 'Blog';

• Where Blog is the name of the controller class you want used. If you now load your main index.php file without specifying any URI segments you’ll see your Hello World message by default.

CODEIGNITER• VIEWS

• A view is simply a web page, or a page fragment, like a header, footer, sidebar, etc. In fact, views can flexibly be embedded within other views (within other views, etc., etc.) if you need this type of hierarchy.

• Views are never called directly, they must be loaded by a controller. Remember that in an MVC framework, the Controller acts as the traffic cop, so it is responsible for fetching a particular view. If you have not read the Controllers page you should do so before continuing.

• Using the example controller you created in the controller page, let’s add a view to it.

CODEIGNITER• EXAMPLE• Using your text editor, create a file called blogview.php, and put this in it:

<html><head>

<title>My Blog</title></head><body>

<h1>Welcome to my Blog!</h1></body></html>

• Then save the file in your application/views/ directory.• Now, open the controller file you made earlier called Blog.php, and replace the echo statement with the view

loading method:<?phpclass Blog extends CI_Controller {

public function index(){

$this->load->view('blogview');}

}

• Call your views with this url belowlocalhost/blog/

CODEIGNITER• MODEL

• Models are PHP classes that are designed to work with information in your database. For example, let’s say you use CodeIgniter to manage a blog.

• You might have a model class that contains functions to insert, update, and retrieve your blog data.

CODEIGNITER• MODEL

class Blog_model extends CI_Model {

public $title;public $content;public $date;public function __construct(){ // Call the CI_Model constructor

parent::__construct();}public function get_last_ten_entries(){ $query = $this->db->get('entries', 10);

return $query->result(); }public function insert_entry(){ $this->title = $_POST['title']; // please read the below note

$this->content = $_POST['content'];$this->date = time();$this->db->insert('entries', $this);

}public function update_entry(){ $this->title = $_POST['title'];

$this->content = $_POST['content'];$this->date = time();$this->db->update('entries', $this, array('id' => $_POST['id']));

}}

CODEIGNITER• LOADING THE MODEL

• Your models will typically be loaded and called from within your controller methods. To load a model you will use the following method:

$this->load->model('model_name');

• ACCESSING THE MODEL

$this->load->model('model_name');

$this->model_name->method();

CODEIGNITER

• CONTROLLER, MODEL AND VIEWS

class Blog_controller extends CI_Controller {

public function blog(){

$this->load->model('blog');

$data['query'] = $this->blog->get_last_ten_entries();

$this->load->view('blog', $data);}

}

CODEIGNITER

• CONNECTING TO YOUR DATABASE

• Open config file belowapplication/config/database.php

• Below is database configuration in database.php$config['hostname'] = 'localhost';$config['username'] = ‘root';$config['password'] = '';$config['database'] = 'mydatabase';$config['dbdriver'] = 'mysqli';$config['dbprefix'] = '';$config['pconnect'] = FALSE;$config['db_debug'] = TRUE;

�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������