Hi I'm a newbie,
My websites has privileges;
When your logged in, privilege=5 and the link "textArea" appears on every htmlPage;
When u click on textArea, you have access to my textArea page that does not exists if you're not logged in which means privilege=0 .
My problem is, I dont want anyone who hasnt logged in to have access to this particular page if privilege=0. example:
localhost/myWebsiteFolder/index.php?idChoice=textArea
-----------------this is my code now I really dont know if I'm on the right path
//define('ID_CHOICE',fct_SESSION('idChoice',"home")); which is in my variableInit.php file;
//this instruction is in another php file.
if (PRIVILEGE == 0)
{
$searchThis=array('idChoice'=> 'editeur');
if (array_key_exists('idChoice',$searchThis)){
echo "-------------------I'm trying to hijack you-------------";
$_SESSION['idChoice] = 'login';
}
$lienLogin = array('idChoice' => 'login');
echo fct_lien ( $lienLogin, 'login');
}else{
$lienLogin = array('idChoice' => 'logout');
echo fct_lien ( $lienLogin, 'logout');
}
please help !
Jakei
How to restrict acess to a page if typed in adressBar
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: How to restrict acess to a page if typed in adressBar
I have to say, I think I read your post 3 times and I'm still not sure what you're trying to accomplish.
Can you give us a specific use case?
Can you give us a specific use case?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: How to restrict acess to a page if typed in adressBar
Code: Select all
<?php
if (PRIVILEGE != 5) {
exit('Access denied');
}