Minggu, 21 Juli 2013

PHP Indonesia - Facebook: #tips-php Untuk menghindari eksekusi langsung fil...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
#tips-php Untuk menghindari eksekusi langsung fil...
Jul 22nd 2013, 03:41, by Erwin Sholeh Siregar

Erwin Sholeh Siregar 3:41am Jul 22
#tips-php

Untuk menghindari eksekusi langsung file php, maka kita dapat menggunakan kata define('INCLUDE_CHECK',true);. Misalnya kita tidak ingin orang mengeksekusi file koneksi.php secara langsung, misal url : http://websiteku.com/koneksi.php. File ini mau dilindungi, file ini harus dieksekusi dari file index.php

Caranya seperti berikut :
pada file koneksi.php, tambahkan kode berikut :
if(!defined('INCLUDE_CHECK')) die('Anda tidak berhak mengeksekusi file ini secara langsung');

Kemudian pada index.php, tambahkan kode berikut :
define('INCLUDE_CHECK',true);

Sekarang file koneksi.php aman dari serangan orang iseng.

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar