Hello there,
I have a big big problem in my project, I have a login page , so everyone log in, the session will be his id
$_SESSION['userid'] = $id;
till now there is no problems, I put a header file to check the user is logged in or not
<?php
if (isset($_SESSION['loggedin']) && isset($_SESSION['userid']) && $_SESSION['loggedin'] == true && !empty($_SESSION['userid'])) {
$SID = $_SESSION['userid'];
$userpro = getusername($SID); // this just to get the username of user
?>
I've also created a** profile.php** to see other users profiles and see there files pictures and other things
Here Is my problem : when user lets say "A" enter on userprofile "B" by url profile.php?user=B its ok,
BUT when he goes to main page or any other page , the user "A" become user "B" and has all previlege of user "B" include commenting, favoriting, delete files for user "B", then imagin what happened if user "A" get previlege of "ADMIN" ? , anything wanted am here, just tell me what to do ?