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 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 ); } ?> 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 Link to comment https://forums.phpfreaks.com/topic/233272-small-question/#findComment-1199682 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.