我建立了一个网站来分享电影之类的图片,但我的隐私问题。当你制作一部照片时,你可以与人分享它的网址,但是那些没有登录我网站的人仍然可以看我的电影http://thephotofilm.com/films/1002947
SELECT path FROM images WHERE img_id=(id)
if($type=="ole")
$type=1;
else
$type=1;
if(!is_numeric($imageIndex) || $imageIndex<0)
invalidImage();
如果用户未登录,则显示空白图片
先谢谢!
答案 0 :(得分:3)
您使用$_session['username']
。
if(isset($_session['username'])){ //change this session to your session name.
echo 'show image here';
}
else{
echo 'tell him wtf are you doing here';
}
答案 1 :(得分:3)
我会使用会话变量进行检查。如果用户具有有效会话,请显示图像。如果没有,请不要显示图像。
这样的事情:
if ($_SESSION['my-session-var']
{
echo '<img src="my-image.jpg" />';
}
else
{
echo '<p>You gotta log in first, ya \'doofis!</p>';
}