Welcome to Abdul Malik Ikhsan's Blog

Menyembunyikan Image path (PHP)

Posted in tips and tricks, Tutorial PHP by samsonasik on November 15, 2009

Untuk kebutuhan keamanan, baiknya kita menyembunyikan path file asset ( misal gambar ) dari web kita. Di php, kita bisa menggunakan header dengan content-type image untuk menyembunyikan target gambar yang diambil dengan kode program seperti berikut  :


<?php
 header('Content-type: image/jpeg');
 $image = "path/to/image/file.jpg";
 $fp = fopen($image,"r");
 echo fpassthru($fp);

?>

Demikian, semoga bermanfaat :).

Advertisements
Tagged with:

One Response

Subscribe to comments with RSS.

  1. script gratis said, on November 28, 2009 at 6:18 am

    nice info, salam kenal mas


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: