is this possible with php? I have a login script and i need a way to check if the session exists so users can view pictures in the directory
reedd5404
0
Newbie Poster
Recommended Answers
Jump to PostIN your Login script how you are checking?
Using database right?
If the user has authenticated then create a session id. Wherever you want to give access to the logged in users then check for session id.
After logging out the user, destroy his session
Jump to Postif(isset($_SESSION['mysite']['user'])){ $imgRights = 1; }
then where the images are output to the screen:
<?php if($imgRights){?> <img src="myimage.png" /> <?php } ?>
There are loads of ways of doing this.
All 5 Replies
saiprem
4
Posting Whiz in Training
reedd5404
0
Newbie Poster
diafol
reedd5404
0
Newbie Poster
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.