QAds
12 Ay Taksit
Samsung I7500 Android 5 MP Camera, Wi-Fi, and 8 GB Memory
$413.79
Samsung I7500 Android 5 MP Camera, Wi-Fi, and 8 GB Memory
$413.79
Coby MP305-4G MP3 Player
$11.07
Nokia N900 Phone/Mobile Computer
$284.48
:: HOME » PHP » How To Hide Image Source
 
How To Hide Image Source

If you want to hide your images source from visiters, you can do such thing:

showimage.PHP file

<?PHP
    Header("Content-type: image/jpeg");
    $exp=GMDate("D, d M Y H:i:s",time()+999);
    Header("Expires: $exp GMT");
   
    $file=$image_path . $_GET["img"]; // getting image name and your image path
    if (file_exists($file)){
    $info=getimagesize($file);
    $width=$info[0];
    $height=$info[1];
    if ($info[2]==1){
        $img=@imagecreatefromgif($file);
    } else if ($info[2]==2){
        $img=@imagecreatefromjpeg($file);
    } else if ($info[2]==3){
        $img=@imagecreatefrompng($file);
    } else {
        $width=640;
        $height=480;
        $file = 'noimage.png'; // if there is not such image, it will show default image
        $img=@imagecreatefrompng($file);
    }
   
    ImageJpeg($img);
    imagedestroy($img);
?>

Dont forget that, you need to have GD supported server to be able to use this PHP feature. For it, talk to your server tech.

$image_path variable should contain your image path and you will send your image name which you want to show.

in HTML file

<img src="showimage.PHP?img=tst.jpg">

as you see we use img HTML tag and at source code, we call our PHP file with image name we want to show.


PHP How To Hide Image Source PHP How To Hide Image Source PHP How To Hide Image Source
PHP How To Hide Image Source
NEW QUESTION
 
Your E-Mail Address
»
Your e-mail will never be shown!  
   
 
Question
»
Please type your question and please use [CODE] tag for your codes!  
  Add CODE Quote BOLD ITALIC Underline Align Left Align Center Align Right Add Line  
   
 
Human Check
»
Enter human check code below!  
   
 
       
 
* Your Question will be answered as soon as possible, probably within 24 hours!
PHP How To Hide Image Source PHP How To Hide Image Source PHP How To Hide Image Source
PHP How To Hide Image Source
 
Website Designer, Search Engine Optimization Expert, Ajax Developer,Developed And Designed By Mumin Celik With Using PHP, MySQL, CSS, JavaScript, Ajax And Search Engine Optimizer Sinema ve Film Rehberi Sudoku Oyunu