robert_gsfame Posted April 10, 2011 Share Posted April 10, 2011 let say i have this <a href="myuploadfolder/picture1.jpg">Picture</a> and when user click on the link, they can see in which folder their picture were kept...is this dangerous?? if yes then how to hide it?? thx in advance Quote Link to comment https://forums.phpfreaks.com/topic/233272-small-question/ Share on other sites More sharing options...
Jnerocorp Posted April 10, 2011 Share Posted April 10, 2011 I wouldnt consider it dangerous unless you dont want people to hotlink your images. but you can stop hotlinking with: <img src="image.php?myfile=image1.jpg"> <?php session_start(); $ticket = "accepted"; session_register($_SESSION["ticket"]); $path="./myuploadfolder/"; // Path to protected directory $mimetype ="image/jpeg"; // Mime type of the file // Check to see if the visitor has the right ticket if ( $_SESSION["ticket"] == "accepted" ) { Header("Content-type: "); readfile ( $path . $myfile ); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/233272-small-question/#findComment-1199675 Share on other sites More sharing options...
robert_gsfame Posted April 10, 2011 Author Share Posted April 10, 2011 thx a lot Quote Link to comment https://forums.phpfreaks.com/topic/233272-small-question/#findComment-1199682 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.